| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | trait PriorityTrait |
||
| 7 | { |
||
| 8 | protected int $priority = 0; |
||
| 9 | |||
| 10 | public function getPriority(): int |
||
| 13 | } |
||
| 14 | |||
| 15 | public function setPriority(int $priority): static |
||
| 16 | { |
||
| 17 | $instance = clone $this; |
||
| 18 | $instance->priority = $priority; |
||
| 19 | return $instance; |
||
| 20 | } |
||
| 21 | |||
| 22 | public static function sortByPriority(array &$haystack): void |
||
| 29 | }); |
||
| 30 | } |
||
| 32 |