Cells   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 50
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 50
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\Cell\ICell;
8
use InvalidArgumentException;
9
use LogicException;
10
11
class Cells extends BaseCollection
12
{
13
    const HEAD = 'thead';
14
15
    /** @var ICell[] */
16
    protected $components = [];
17
18
    /**
19
     * @return ICell
20
     * @throws LogicException
21
     */
22 5
    public function current()
23
    {
24
        /** @var ICell $object */
25 5
        $object = parent::current();
26
27 5
        $this->verifyReturn($object, ICell::class);
28
29 5
        return $object;
30
    }
31
32
    /**
33
     * @param int|null $offset
34
     * @param ICell    $value
35
     *
36
     * @throws InvalidArgumentException
37
     */
38 12
    public function offsetSet($offset, $value)
39
    {
40 12
        $this->verifyArgument($value, ICell::class);
41
42 11
        parent::offsetSet($offset, $value);
43 11
    }
44
45
    /**
46
     * @param int $offset
47
     *
48
     * @return ICell|null
49
     * @throws LogicException
50
     */
51 1
    public function offsetGet($offset)
52
    {
53
        /** @var ICell $object */
54 1
        $object = parent::offsetGet($offset);
55
56 1
        $this->verifyReturn($object, ICell::class);
57
58 1
        return $object;
59
    }
60
}
61