AbstractQueue   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 26
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 5 1
A containerInternalName() 0 4 1
1
<?php
2
namespace GenericCollections\Abstracts;
3
4
use GenericCollections\Interfaces\QueueInterface;
5
use GenericCollections\Internal\DataDoubleLinkedList;
6
use GenericCollections\Traits\CollectionMethods;
7
use GenericCollections\Traits\DequeCommonMethods;
8
9
abstract class AbstractQueue extends DataDoubleLinkedList implements QueueInterface
10
{
11
    use CollectionMethods;
12
13
    use DequeCommonMethods {
14
        addLast as private;     // used in add
15
        addFirst as private;    // not really needed
16
        offerLast as offer;
17
        offerFirst as private;  // not really needed
18
        getFirst as element;
19
        peekFirst as peek;
20
        removeFirst as remove;
21
        pollFirst as poll;
22
    }
23
24 6
    public function add($element)
25
    {
26 6
        $this->addLast($element);
27 5
        return true;
28
    }
29
30 1
    protected function containerInternalName()
31
    {
32 1
        return 'queue';
33
    }
34
}
35