Skip to content

Commit

Permalink
Closes #85
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 15, 2020
1 parent 1de7b33 commit 266d85e
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,6 @@ return PhpCsFixer\Config::create()
'property',
],
],
'void_return' => true,
'void_return' => false,
'whitespace_after_comma_in_array' => true,
]);
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ArrayComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/DOMNodeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/DateTimeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/DoubleComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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) {
Expand All @@ -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 = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/NumericComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ObjectComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/ResourceComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/ScalarComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/SplObjectStorageComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/TypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 266d85e

Please sign in to comment.