Skip to content

Commit

Permalink
Merge branch '5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 18, 2024
2 parents 6490c6d + a18251e commit 1210eed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 50 deletions.
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt

* Removed support for PHP 8.1

## [5.0.3] - 2024-10-18

### Fixed

* Reverted [#113](https://github.com/sebastianbergmann/comparator/pull/113) as it broke backward compatibility

## [5.0.2] - 2024-08-12

### Fixed
Expand Down Expand Up @@ -178,6 +184,7 @@ All notable changes are documented in this file using the [Keep a CHANGELOG](htt
[6.0.2]: https://github.com/sebastianbergmann/comparator/compare/6.0.1...6.0.2
[6.0.1]: https://github.com/sebastianbergmann/comparator/compare/6.0.0...6.0.1
[6.0.0]: https://github.com/sebastianbergmann/comparator/compare/5.0...6.0.0
[5.0.3]: https://github.com/sebastianbergmann/comparator/compare/5.0.2...5.0.3
[5.0.2]: https://github.com/sebastianbergmann/comparator/compare/5.0.1...5.0.2
[5.0.1]: https://github.com/sebastianbergmann/comparator/compare/5.0.0...5.0.1
[5.0.0]: https://github.com/sebastianbergmann/comparator/compare/4.0.8...5.0.0
Expand Down
10 changes: 2 additions & 8 deletions src/ArrayComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
namespace SebastianBergmann\Comparator;

use function array_is_list;
use function array_key_exists;
use function assert;
use function is_array;
Expand Down Expand Up @@ -42,13 +41,8 @@ public function assertEquals(mixed $expected, mixed $actual, float $delta = 0.0,
assert(is_array($actual));

if ($canonicalize) {
if (array_is_list($expected)) {
sort($expected);
}

if (array_is_list($actual)) {
sort($actual);
}
sort($expected);
sort($actual);
}

$remaining = $actual;
Expand Down
42 changes: 0 additions & 42 deletions tests/unit/ArrayComparatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,30 +73,6 @@ public static function assertEqualsSucceedsProvider(): array
['true'],
[true],
],
[
[1, [1, 2, 3]],
[[3, 1, 2], 1],
0,
true,
],
[
[1, [4, 7], [1, 2, 3], [0, 0, 0, 0]],
[[3, 1, 2], [0, 0, 0, 0], [4, 7], 1],
0,
true,
],
[
[1, [4, [4, 5, 6, 7, 8]], [1, 2, 3]],
[[3, 1, 2], [[4, 8, 6, 7, 5], 4], 1],
0,
true,
],
[
[null, null, 1, 1],
[1, null, 1, null],
0,
true,
],
];
}

Expand Down Expand Up @@ -145,24 +121,6 @@ public static function assertEqualsFailsProvider(): array
['false'],
[false],
],
[
['a' => '1', 'b' => '2'],
['c' => '1', 'd' => '2'],
0,
true,
],
[
['a' => '1', 'b' => '2'],
['a' => '2', 'b' => '1'],
0,
true,
],
[
['a' => '1', 'b' => '2'],
['a' => '1', 'b' => '2', 'c' => '2'],
0,
true,
],
];
}

Expand Down

0 comments on commit 1210eed

Please sign in to comment.