Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions library/Rules/Unique.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
use function array_unique;
use function is_array;

use const SORT_REGULAR;

/**
* Validates whether the input array contains only unique values.
*
Expand All @@ -32,6 +30,6 @@ public function validate($input): bool
return false;
}

return $input == array_unique($input, SORT_REGULAR);
return $input == array_unique($input);
}
}
1 change: 1 addition & 0 deletions tests/unit/Rules/UniqueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static function providerForValidInput(): array
[$rule, [true, false]],
[$rule, ['alpha', 'beta', 'gamma', 'delta']],
[$rule, [0, 2.71, 3.14]],
[$rule, ['14.0', '14.1', '14.10']],
[$rule, [[], ['str'], [1]]],
[$rule, [(object) ['key' => 'value'], (object) ['other_key' => 'value']]],
];
Expand Down
Loading