| 1 | <?php |
||
| 21 | class UniquePriorityQueue extends PriorityQueue |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * {@inheritDoc} |
||
| 25 | */ |
||
| 26 | public function count() |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritDoc} |
||
| 33 | */ |
||
| 34 | public function getIterator() |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Remove duplicated items |
||
| 44 | * |
||
| 45 | * @param mixed[] $input |
||
| 46 | * @return mixed[] |
||
| 47 | */ |
||
| 48 | protected function getUnique(array $input): array |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Generate related key base on value |
||
| 62 | * |
||
| 63 | * @param mixed $val |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | protected function getKey($val): string |
||
| 77 | } |