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

FilterCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 21
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A current() 0 4 1
A append() 0 7 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
}