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

AbstractQueue::containerInternalName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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