Conditions | 7 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 7 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 54 | public function compare($value, $comparativeValue): int |
|
30 | { |
||
31 | 54 | if ($this->nullableSort === self::NULL_VALUES_LAST && ($comparativeValue === null || $value === null)) { |
|
32 | 1 | return $comparativeValue <=> $value; |
|
33 | } |
||
34 | |||
35 | 54 | if ($this->nullableSort === self::NULL_VALUES_FIRST && ($comparativeValue === null || $value === null)) { |
|
36 | 2 | return 1; |
|
37 | } |
||
38 | |||
39 | 54 | $result = parent::compare((string) $value, (string) $comparativeValue); |
|
40 | |||
41 | 54 | assert(is_int($result)); |
|
42 | |||
43 | 54 | return $result; |
|
44 | } |
||
46 |