@@ 166-176 (lines=11) @@ | ||
163 | /** |
|
164 | * @inheritDoc |
|
165 | */ |
|
166 | public function pop() |
|
167 | { |
|
168 | if ($this->isEmpty()) { |
|
169 | throw new UnderflowException(); |
|
170 | } |
|
171 | ||
172 | $value = array_pop($this->array); |
|
173 | $this->checkCapacity(); |
|
174 | ||
175 | return $value; |
|
176 | } |
|
177 | ||
178 | /** |
|
179 | * @inheritDoc |
|
@@ 268-278 (lines=11) @@ | ||
265 | /** |
|
266 | * @inheritDoc |
|
267 | */ |
|
268 | public function shift() |
|
269 | { |
|
270 | if ($this->isEmpty()) { |
|
271 | throw new UnderflowException(); |
|
272 | } |
|
273 | ||
274 | $value = array_shift($this->array); |
|
275 | $this->checkCapacity(); |
|
276 | ||
277 | return $value; |
|
278 | } |
|
279 | ||
280 | /** |
|
281 | * @inheritDoc |