diff --git a/.php_cs.dist b/.php_cs.dist index 755afc0..41a47c3 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -193,6 +193,6 @@ return PhpCsFixer\Config::create() 'property', ], ], - 'void_return' => true, + 'void_return' => false, 'whitespace_after_comma_in_array' => true, ]); diff --git a/ChangeLog.md b/ChangeLog.md index 6de6c5a..b0aa9f3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [4.0.2] - 2020-06-15 + +### Fixed + +* [#53](https://github.com/sebastianbergmann/comparator/issues/85): Version 4.0.1 breaks backward compatibility + ## [4.0.1] - 2020-06-15 ### Changed @@ -62,6 +68,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt * Added `SebastianBergmann\Comparator\Factory::reset()` to unregister all non-default comparators * Added support for `phpunit/phpunit-mock-objects` version `^5.0` +[4.0.2]: https://github.com/sebastianbergmann/comparator/compare/4.0.1...4.0.2 [4.0.1]: https://github.com/sebastianbergmann/comparator/compare/4.0.0...4.0.1 [4.0.0]: https://github.com/sebastianbergmann/comparator/compare/3.0.2...4.0.0 [3.0.2]: https://github.com/sebastianbergmann/comparator/compare/3.0.1...3.0.2 diff --git a/src/ArrayComparator.php b/src/ArrayComparator.php index a13add8..9f1c399 100644 --- a/src/ArrayComparator.php +++ b/src/ArrayComparator.php @@ -43,7 +43,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ { if ($canonicalize) { \sort($expected); diff --git a/src/Comparator.php b/src/Comparator.php index 8534e7f..e1906c1 100644 --- a/src/Comparator.php +++ b/src/Comparator.php @@ -31,7 +31,7 @@ public function __construct() $this->exporter = new Exporter; } - public function setFactory(Factory $factory): void + public function setFactory(Factory $factory)/*: void*/ { $this->factory = $factory; } diff --git a/src/DOMNodeComparator.php b/src/DOMNodeComparator.php index 558e740..ac6f1e8 100644 --- a/src/DOMNodeComparator.php +++ b/src/DOMNodeComparator.php @@ -42,7 +42,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ { $expectedAsString = $this->nodeToText($expected, true, $ignoreCase); $actualAsString = $this->nodeToText($actual, true, $ignoreCase); diff --git a/src/DateTimeComparator.php b/src/DateTimeComparator.php index 1222ed5..3d28e70 100644 --- a/src/DateTimeComparator.php +++ b/src/DateTimeComparator.php @@ -41,7 +41,7 @@ public function accepts($expected, $actual) * @throws \Exception * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ { /** @var \DateTimeInterface $expected */ /** @var \DateTimeInterface $actual */ diff --git a/src/DoubleComparator.php b/src/DoubleComparator.php index cf90366..a851c7a 100644 --- a/src/DoubleComparator.php +++ b/src/DoubleComparator.php @@ -45,7 +45,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ { if ($delta == 0) { $delta = self::EPSILON; diff --git a/src/Factory.php b/src/Factory.php index de70229..7131f38 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -84,7 +84,7 @@ public function getComparatorFor($expected, $actual) * * @param Comparator $comparator The comparator to be registered */ - public function register(Comparator $comparator): void + public function register(Comparator $comparator)/*: void*/ { \array_unshift($this->customComparators, $comparator); @@ -98,7 +98,7 @@ public function register(Comparator $comparator): void * * @param Comparator $comparator The comparator to be unregistered */ - public function unregister(Comparator $comparator): void + public function unregister(Comparator $comparator)/*: void*/ { foreach ($this->customComparators as $key => $_comparator) { if ($comparator === $_comparator) { @@ -110,7 +110,7 @@ public function unregister(Comparator $comparator): void /** * Unregisters all non-default comparators. */ - public function reset(): void + public function reset()/*: void*/ { $this->customComparators = []; } diff --git a/src/NumericComparator.php b/src/NumericComparator.php index 31d8050..61537ca 100644 --- a/src/NumericComparator.php +++ b/src/NumericComparator.php @@ -42,7 +42,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ { if ($this->isInfinite($actual) && $this->isInfinite($expected)) { return; diff --git a/src/ObjectComparator.php b/src/ObjectComparator.php index 7a9612a..f3b7dac 100644 --- a/src/ObjectComparator.php +++ b/src/ObjectComparator.php @@ -39,7 +39,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = []): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false, array &$processed = [])/*: void*/ { if (\get_class($actual) !== \get_class($expected)) { throw new ComparisonFailure( diff --git a/src/ResourceComparator.php b/src/ResourceComparator.php index 4ffe931..fcd1edf 100644 --- a/src/ResourceComparator.php +++ b/src/ResourceComparator.php @@ -38,7 +38,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ { if ($actual != $expected) { throw new ComparisonFailure( diff --git a/src/ScalarComparator.php b/src/ScalarComparator.php index 8043c0e..3f3ccc1 100644 --- a/src/ScalarComparator.php +++ b/src/ScalarComparator.php @@ -44,7 +44,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ { $expectedToCompare = $expected; $actualToCompare = $actual; diff --git a/src/SplObjectStorageComparator.php b/src/SplObjectStorageComparator.php index d9c6b19..01fcebb 100644 --- a/src/SplObjectStorageComparator.php +++ b/src/SplObjectStorageComparator.php @@ -38,7 +38,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ { foreach ($actual as $object) { if (!$expected->contains($object)) { diff --git a/src/TypeComparator.php b/src/TypeComparator.php index 18b2850..9131fb8 100644 --- a/src/TypeComparator.php +++ b/src/TypeComparator.php @@ -38,7 +38,7 @@ public function accepts($expected, $actual) * * @throws ComparisonFailure */ - public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false): void + public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = false, $ignoreCase = false)/*: void*/ { if (\gettype($expected) != \gettype($actual)) { throw new ComparisonFailure(