Mercurial > hg > cmmr2012-drupal-site
diff vendor/sebastian/comparator/src/ScalarComparator.php @ 2:5311817fb629
Theme updates
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 13:19:18 +0000 |
parents | c75dbcec494b |
children |
line wrap: on
line diff
--- a/vendor/sebastian/comparator/src/ScalarComparator.php Thu Jul 05 15:32:06 2018 +0100 +++ b/vendor/sebastian/comparator/src/ScalarComparator.php Tue Jul 10 13:19:18 2018 +0000 @@ -1,6 +1,6 @@ <?php /* - * This file is part of the Comparator package. + * This file is part of sebastian/comparator. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * @@ -18,18 +18,20 @@ /** * Returns whether the comparator can compare two values. * - * @param mixed $expected The first value to compare - * @param mixed $actual The second value to compare + * @param mixed $expected The first value to compare + * @param mixed $actual The second value to compare + * * @return bool + * * @since Method available since Release 3.6.0 */ public function accepts($expected, $actual) { - return ((is_scalar($expected) xor null === $expected) && - (is_scalar($actual) xor null === $actual)) + return ((\is_scalar($expected) xor null === $expected) && + (\is_scalar($actual) xor null === $actual)) // allow comparison between strings and objects featuring __toString() - || (is_string($expected) && is_object($actual) && method_exists($actual, '__toString')) - || (is_object($expected) && method_exists($expected, '__toString') && is_string($actual)); + || (\is_string($expected) && \is_object($actual) && \method_exists($actual, '__toString')) + || (\is_object($expected) && \method_exists($expected, '__toString') && \is_string($actual)); } /** @@ -50,18 +52,18 @@ // always compare as strings to avoid strange behaviour // otherwise 0 == 'Foobar' - if (is_string($expected) || is_string($actual)) { + if (\is_string($expected) || \is_string($actual)) { $expectedToCompare = (string) $expectedToCompare; $actualToCompare = (string) $actualToCompare; if ($ignoreCase) { - $expectedToCompare = strtolower($expectedToCompare); - $actualToCompare = strtolower($actualToCompare); + $expectedToCompare = \strtolower($expectedToCompare); + $actualToCompare = \strtolower($actualToCompare); } } if ($expectedToCompare != $actualToCompare) { - if (is_string($expected) && is_string($actual)) { + if (\is_string($expected) && \is_string($actual)) { throw new ComparisonFailure( $expected, $actual, @@ -79,7 +81,7 @@ '', '', false, - sprintf( + \sprintf( 'Failed asserting that %s matches expected %s.', $this->exporter->export($actual), $this->exporter->export($expected)