Conditions | 7 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | public function compare(mixed $value, mixed $comparativeValue): int |
||
19 | { |
||
20 | if (($comparativeValue === null || $value === null) && $this->config->getNullableSort() === Configuration::NULL_VALUES_LAST) { |
||
21 | return $comparativeValue <=> $value; |
||
22 | } |
||
23 | |||
24 | if (($comparativeValue === null || $value === null) && $this->config->getNullableSort() === Configuration::NULL_VALUES_FIRST) { |
||
25 | return Configuration::NULL_VALUES_FIRST; |
||
26 | } |
||
27 | |||
28 | $result = $this->collator->compare((string) $value, (string) $comparativeValue); |
||
29 | |||
30 | assert(is_int($result)); |
||
31 | |||
32 | return $result; |
||
33 | } |
||
35 |