Completed
Push — master ( c3b775...3173eb )
by Derek Stephen
01:53
created

FilterCollection::append()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Del\Filter\Collection;
4
5
use ArrayIterator;
6
use Del\Filter\Filter\FilterInterface;
7
use InvalidArgumentException;
8
9
class FilterCollection extends ArrayIterator
10
{
11
    /**
12
     * @return FilterInterface
13
     */
14 1
    public function current()
15
    {
16 1
        return parent::current();
17
    }
18
19
    /**
20
     * @param FilterInterface $filter
21
     */
22 2
    public function append($filter)
23
    {
24 2
        if (!$filter instanceof FilterInterface) {
25 1
            throw new InvalidArgumentException('You must append a Del\Filter\Filter\FilterInterface');
26
        }
27 1
        parent::append($filter);
28
    }
29
}