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

Queue::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 5
loc 5
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 “first in, first out” or “FIFO” collection that only allows access to the
13
 * value at the front of the queue and iterates in that order, destructively.
14
 *
15
 * @package structures
16
 * @author Ulises Jeremias Cornejo Fandos <[email protected]>
17
 */
18
19
class Queue extends DoublyLinkedList
20
{
21
    /**
22
     * @inheritDoc
23
     */
24
    public function peek()
25
    {
26
        return $this->deque->first();
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function pop()
33
    {
34
        return $this->deque->shift();
35
    }
36
}
37