| Conditions | 9 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 9 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 18 | public function default(): callable |
|
| 62 | { |
||
| 63 | 18 | return function ($current, $next) { |
|
| 64 | 18 | $current = $this->lower($current); |
|
| 65 | 18 | $next = $this->lower($next); |
|
| 66 | |||
| 67 | 18 | if ($current === $next) { |
|
| 68 | 2 | return 0; |
|
| 69 | } |
||
| 70 | |||
| 71 | 18 | if (is_string($current) && is_numeric($next)) { |
|
| 72 | 12 | return $this->hasSpecialChar($current) ? -1 : 1; |
|
| 73 | } |
||
| 74 | |||
| 75 | 18 | if (is_numeric($current) && is_string($next)) { |
|
| 76 | 12 | return $this->hasSpecialChar($next) ? 1 : -1; |
|
| 77 | } |
||
| 78 | |||
| 79 | 18 | return $current < $next ? -1 : 1; |
|
| 80 | 18 | }; |
|
| 107 |