Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
30 | 5 | public function compare(mixed $a, mixed $b): int { |
|
31 | 5 | if (! $a instanceof Comparable) { |
|
32 | 1 | throw new InvalidArgumentException( |
|
33 | 1 | "ComparableComparator can compare only objects implementing phootwork\lang\Comparable interface" |
|
34 | 1 | ); |
|
35 | } |
||
36 | |||
37 | 4 | return $a->compareTo($b); |
|
38 | } |
||
40 |