| Conditions | 2 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 3 | public function sort(array $values) : array |
|
| 27 | { |
||
| 28 | 3 | $collator = $this->collator; |
|
| 29 | 3 | uksort( |
|
| 30 | 3 | $values, |
|
| 31 | static function ($first, $second) use ($collator) : int { |
||
| 32 | /** @var int|false $result */ |
||
| 33 | 3 | $result = $collator->compare((string) $first, (string) $second); |
|
| 34 | 3 | if (false === $result) { |
|
| 35 | 1 | throw IntlSortException::errorOnSort(); |
|
| 36 | } |
||
| 37 | |||
| 38 | 2 | return $result; |
|
| 39 | 3 | } |
|
| 40 | ); |
||
| 41 | |||
| 42 | 2 | return $values; |
|
| 43 | } |
||
| 44 | } |