AbstractQueue::add()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
crap 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