Passed
Push — 1.x ( 36b118...cb0b9f )
by Ulises Jeremias
02:31
created

DoublyLinkedList::clear()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 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
use Mbh\Collection\Interfaces\Collection as CollectionInterface;
12
use Mbh\Collection\Interfaces\Functional as FunctionalInterface;
13
use Mbh\Collection\Interfaces\Sequenceable as SequenceableInterface;
14
use Mbh\Collection\Internal\Interfaces\LinkedNode;
15
use Mbh\Collection\Internal\LinkedDataNode;
16
use Mbh\Collection\Internal\LinkedTerminalNode;
17
use Mbh\Interfaces\Allocated as AllocatedInterface;
18
use Mbh\Traits\Capacity;
19
use Mbh\Traits\EmptyGuard;
20
use SplFixedArray;
21
use Traversable;
22
use OutOfBoundsException;
23
use Exception;
24
25
/**
26
 * The DoublyLinkedList
27
 *
28
 *
29
 *
30
 * @package structures
31
 * @author Ulises Jeremias Cornejo Fandos <[email protected]>
32
 */
33
final class DoublyLinkedList implements AllocatedInterface, FunctionalInterface, SequenceableInterface
34
{
35
    use Traits\Sequenceable\LinkedList;
36
    use Traits\Builder;
37
    use Traits\Collection;
38
    use Traits\Functional;
39
    use Capacity;
40
    use EmptyGuard;
41
42
    const MIN_CAPACITY = 8.0;
43
44
    protected $head;
45
    protected $tail;
46
    protected $size = 0;
47
    protected $current;
48
    protected $offset = -1;
49
}
50