DataDoubleLinkedList   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 46
ccs 14
cts 14
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
createStorageObject() 0 1 ?
A clear() 0 4 1
A isEmpty() 0 4 1
A toArray() 0 8 2
A count() 0 4 1
A getIterator() 0 4 1
1
<?php
2
namespace GenericCollections\Internal;
3
4
abstract class DataDoubleLinkedList implements StorageInterface
5
{
6
    /**
7
     * Local storage for members
8
     *
9
     * @var DoubleLinkedList
10
     */
11
    protected $storage;
12
13
    /**
14
     * Create a new empty DoubleLinkedList and set it
15
     * on protected variable $storage
16
     *
17
     * @return void
18
     */
19
    abstract protected function createStorageObject();
20
21 1
    public function clear()
22
    {
23 1
        $this->storage->clear();
24 1
    }
25
26 26
    public function isEmpty()
27
    {
28 26
        return $this->storage->isEmpty();
29
    }
30
31 22
    public function toArray()
32
    {
33 22
        $array = [];
34 22
        foreach ($this->storage as $element) {
35 21
            $array[] = $element;
36
        }
37 22
        return $array;
38
    }
39
40 29
    public function count()
41
    {
42 29
        return $this->storage->count();
43
    }
44
45 1
    public function getIterator()
46
    {
47 1
        return new \IteratorIterator($this->storage);
48
    }
49
}
50