Total Complexity | 4 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | class MiniStack extends Collection |
||
31 | { |
||
32 | /** |
||
33 | * The stack size. |
||
34 | * |
||
35 | * @var int |
||
36 | */ |
||
37 | protected int $size = 0; |
||
38 | |||
39 | /** |
||
40 | * MiniStack Constructor. |
||
41 | * |
||
42 | * @param int $size The maximum amount of slices the stack can contain. |
||
43 | */ |
||
44 | public function __construct(int $size = 0) |
||
45 | { |
||
46 | parent::__construct(); |
||
47 | |||
48 | $this->size = $size; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * Push an item to the MiniStack. |
||
53 | * |
||
54 | * @param mixed $value The value to push |
||
55 | * |
||
56 | * @return void |
||
57 | */ |
||
58 | public function push($value): void |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * Return the MiniStack size. |
||
70 | * |
||
71 | * @return int |
||
72 | */ |
||
73 | public function getSize(): int |
||
76 | } |
||
77 | } |
||
78 |