public function Factory::getComparatorFor in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/sebastian/comparator/src/Factory.php \SebastianBergmann\Comparator\Factory::getComparatorFor()
Returns the correct comparator for comparing two values.
Parameters
mixed $expected The first value to compare:
mixed $actual The second value to compare:
Return value
File
- vendor/
sebastian/ comparator/ src/ Factory.php, line 66
Class
- Factory
- Factory for comparators which compare values for equality.
Namespace
SebastianBergmann\ComparatorCode
public function getComparatorFor($expected, $actual) {
foreach ($this->comparators as $comparator) {
if ($comparator
->accepts($expected, $actual)) {
return $comparator;
}
}
}