Passed
Push — 1.x ( 09aaed...cb25d4 )
by Ulises Jeremias
02:40
created

Stack::offsetSet()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 6
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php namespace Mbh\Collection;
2
3
/**
4
 * MBHFramework
5
 *
6
 * @link      https://github.com/MBHFramework/mbh-framework
7
 * @copyright Copyright (c) 2017 Ulises Jeremias Cornejo Fandos
8
 * @license   https://github.com/MBHFramework/mbh-framework/blob/master/LICENSE (MIT License)
9
 */
10
11
/**
12
 * A “last in, first out” or “LIFO” collection that only allows access to the
13
 * value at the top of the structure and iterates in that order, destructively.
14
 *
15
 * @package structures
16
 * @author Ulises Jeremias Cornejo Fandos <[email protected]>
17
 */
18
19
class Stack extends DoublyLinkedList
20
{
21
    /**
22
     * @inheritDoc
23
     */
24
    public function peek()
25
    {
26
        return $this->deque->last();
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function pop()
33
    {
34
        return $this->deque->pop();
35
    }
36
}
37