| Conditions | 2 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 2 | public function sort(string $direction = self::SORT_ASC) : void |
|
| 42 | { |
||
| 43 | usort($this->versions, function (Version $a, Version $b) use ($direction) { |
||
| 44 | 2 | $result = $a->compareTo($b); |
|
| 45 | |||
| 46 | 2 | if ($direction === self::SORT_DESC) { |
|
| 47 | 1 | $result *= -1; |
|
| 48 | } |
||
| 49 | |||
| 50 | 2 | return $result; |
|
| 51 | 2 | }); |
|
| 52 | 2 | } |
|
| 53 | |||
| 64 |