| Total Complexity | 9 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class ArrayQueue extends AbstractCollection implements Queue, IndexIterable |
||
| 14 | { |
||
| 15 | use RemoveTraverseTrait; |
||
| 16 | |||
| 17 | 1 | public function offer($element): bool |
|
| 20 | } |
||
| 21 | |||
| 22 | 4 | public function poll() |
|
| 30 | } |
||
| 31 | |||
| 32 | 3 | public function peek() |
|
| 33 | { |
||
| 34 | 3 | if ($this->isEmpty()) { |
|
| 35 | 1 | throw new RuntimeException('Queue is empty'); |
|
| 36 | } |
||
| 37 | |||
| 38 | 2 | return $this->elements[0]; |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | public function stream(): Stream |
|
| 42 | { |
||
| 43 | 1 | return new SerialStream($this); |
|
| 44 | } |
||
| 45 | |||
| 46 | 5 | public function getIndexIterator(): Iterator |
|
| 49 | } |
||
| 50 | |||
| 51 | 6 | protected function afterElementAdd($element): void |
|
| 52 | { |
||
| 53 | 6 | } |
|
| 54 | |||
| 55 | 20 | protected function afterElementsSet(): void |
|
| 57 | 20 | } |
|
| 58 | } |
||
| 59 |