Total Complexity | 8 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | class ArrayStack extends AbstractCollection implements Stack, IndexIterable |
||
14 | { |
||
15 | |||
16 | use RemoveTraverseTrait; |
||
17 | |||
18 | /** |
||
19 | * Adds element to the top of stack |
||
20 | * |
||
21 | * @param $element |
||
22 | * |
||
23 | * @return bool |
||
24 | */ |
||
25 | 1 | public function push($element): bool |
|
28 | } |
||
29 | |||
30 | /** |
||
31 | * Gets element from the top of stack |
||
32 | * |
||
33 | * @return mixed |
||
34 | */ |
||
35 | 2 | public function pop() |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * Retrieves, but does not remove |
||
46 | * |
||
47 | * @return mixed |
||
48 | */ |
||
49 | 3 | public function peek() |
|
56 | } |
||
57 | |||
58 | 2 | public function stream(): Stream |
|
61 | } |
||
62 | 2 | ||
63 | public function toArray(): array |
||
66 | } |
||
67 | 1 | ||
68 | public function getIndexIterator(): Iterator |
||
73 |