diff --git a/src/Collator/ConfigurableCollator.php b/src/Collator/ConfigurableCollator.php index 20d962b..ff5fdbb 100644 --- a/src/Collator/ConfigurableCollator.php +++ b/src/Collator/ConfigurableCollator.php @@ -7,6 +7,7 @@ use Budgegeria\IntlSort\Exception\IntlSortException; use Collator as IntlCollator; use IntlException; +use Override; use function assert; use function is_int; @@ -18,6 +19,7 @@ public function __construct(private readonly IntlCollator $collator, private rea } /** @throws IntlSortException */ + #[Override] public function compare(mixed $value, mixed $comparativeValue): int { if ($this->isNullFirst($value, $comparativeValue)) { diff --git a/src/Comparator/CallableAccess.php b/src/Comparator/CallableAccess.php index 12bc4ea..ba71162 100644 --- a/src/Comparator/CallableAccess.php +++ b/src/Comparator/CallableAccess.php @@ -6,6 +6,7 @@ use Budgegeria\IntlSort\Collator\Collator; use Closure; +use Override; class CallableAccess implements Comparable { @@ -18,6 +19,7 @@ public function __construct(private readonly Collator $collator, callable $func) $this->func = $func(...); } + #[Override] public function compare(mixed $value, mixed $comparativeValue): int { return $this->collator->compare( diff --git a/src/Comparator/Comparator.php b/src/Comparator/Comparator.php index 70313df..92a0341 100644 --- a/src/Comparator/Comparator.php +++ b/src/Comparator/Comparator.php @@ -5,6 +5,7 @@ namespace Budgegeria\IntlSort\Comparator; use Budgegeria\IntlSort\Collator\Collator; +use Override; class Comparator implements Comparable { @@ -12,6 +13,7 @@ public function __construct(private readonly Collator $collator) { } + #[Override] public function compare(mixed $value, mixed $comparativeValue): int { return $this->collator->compare($value, $comparativeValue); diff --git a/src/ComparatorFactory/CallableAccess.php b/src/ComparatorFactory/CallableAccess.php index 92fd2b7..0ee2508 100644 --- a/src/ComparatorFactory/CallableAccess.php +++ b/src/ComparatorFactory/CallableAccess.php @@ -8,6 +8,7 @@ use Budgegeria\IntlSort\Comparator\CallableAccess as Comparator; use Budgegeria\IntlSort\Comparator\Comparable; use Closure; +use Override; class CallableAccess implements Factory { @@ -20,6 +21,7 @@ public function __construct(callable $func) $this->func = $func(...); } + #[Override] public function create(Collator $collator): Comparable { return new Comparator($collator, $this->func); diff --git a/src/ComparatorFactory/Standard.php b/src/ComparatorFactory/Standard.php index 8869030..741b764 100644 --- a/src/ComparatorFactory/Standard.php +++ b/src/ComparatorFactory/Standard.php @@ -7,9 +7,11 @@ use Budgegeria\IntlSort\Collator\Collator; use Budgegeria\IntlSort\Comparator\Comparable; use Budgegeria\IntlSort\Comparator\Comparator; +use Override; class Standard implements Factory { + #[Override] public function create(Collator $collator): Comparable { return new Comparator($collator); diff --git a/src/Sorter/Asc.php b/src/Sorter/Asc.php index 62e228e..9d4ffbb 100644 --- a/src/Sorter/Asc.php +++ b/src/Sorter/Asc.php @@ -5,6 +5,7 @@ namespace Budgegeria\IntlSort\Sorter; use Budgegeria\IntlSort\Comparator\Comparable; +use Override; use function uasort; @@ -17,6 +18,7 @@ public function __construct(private readonly Comparable $comparable) /** * {@inheritDoc} */ + #[Override] public function sort(array $values): array { $comparable = $this->comparable; diff --git a/src/Sorter/Desc.php b/src/Sorter/Desc.php index 434f696..40e3863 100644 --- a/src/Sorter/Desc.php +++ b/src/Sorter/Desc.php @@ -4,6 +4,8 @@ namespace Budgegeria\IntlSort\Sorter; +use Override; + use function array_reverse; final class Desc implements Sorter @@ -15,6 +17,7 @@ public function __construct(private readonly Sorter $sorter) /** * {@inheritDoc} */ + #[Override] public function sort(array $values): array { $values = $this->sorter->sort($values); diff --git a/src/Sorter/Key.php b/src/Sorter/Key.php index d51a1fe..fee5de7 100644 --- a/src/Sorter/Key.php +++ b/src/Sorter/Key.php @@ -5,6 +5,7 @@ namespace Budgegeria\IntlSort\Sorter; use Budgegeria\IntlSort\Comparator\Comparable; +use Override; use function uksort; @@ -17,6 +18,7 @@ public function __construct(private readonly Comparable $comparable) /** * {@inheritDoc} */ + #[Override] public function sort(array $values): array { $comparable = $this->comparable; diff --git a/src/Sorter/Omit.php b/src/Sorter/Omit.php index 7550ac4..15de3f0 100644 --- a/src/Sorter/Omit.php +++ b/src/Sorter/Omit.php @@ -4,6 +4,8 @@ namespace Budgegeria\IntlSort\Sorter; +use Override; + use function array_values; final class Omit implements Sorter @@ -13,6 +15,7 @@ public function __construct(private readonly Sorter $sorter) } /** @inheritdoc */ + #[Override] public function sort(array $values): array { $values = $this->sorter->sort($values);