Filters   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A current() 0 9 1
A offsetSet() 0 6 1
A offsetGet() 0 9 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Foo\Grid\Collection;
6
7
use Foo\Grid\Filter\IFilter;
8
use InvalidArgumentException;
9
use LogicException;
10
11
class Filters extends BaseCollection
12
{
13
    /** @var IFilter[] */
14
    protected $components = [];
15
16
    /**
17
     * @return IFilter
18
     * @throws LogicException
19
     */
20 5
    public function current()
21
    {
22
        /** @var IFilter $object */
23 5
        $object = parent::current();
24
25 5
        $this->verifyReturn($object, IFilter::class);
26
27 5
        return $object;
28
    }
29
30
    /**
31
     * @param int|null $offset
32
     * @param IFilter  $value
33
     *
34
     * @throws InvalidArgumentException
35
     */
36 12
    public function offsetSet($offset, $value)
37
    {
38 12
        $this->verifyArgument($value, IFilter::class);
39
40 11
        parent::offsetSet($offset, $value);
41 11
    }
42
43
    /**
44
     * @param int $offset
45
     *
46
     * @return IFilter|null
47
     * @throws LogicException
48
     */
49 1
    public function offsetGet($offset)
50
    {
51
        /** @var IFilter $object */
52 1
        $object = parent::offsetGet($offset);
53
54 1
        $this->verifyReturn($object, IFilter::class);
55
56 1
        return $object;
57
    }
58
}
59