Completed
Pull Request — master (#5)
by Carlos C
13:10
created

AbstractQueue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

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

2 Methods

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