Manager   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 6
c 2
b 0
f 0
dl 0
loc 25
ccs 0
cts 6
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getIterator() 0 3 1
A row() 0 7 1
1
<?php
2
3
namespace Terranet\Administrator\Dashboard;
4
5
use Closure;
6
use IteratorAggregate;
7
8
class Manager implements IteratorAggregate
9
{
10
    /** @var array */
11
    protected $rows = [];
12
13
    /**
14
     * @param Closure $callback
15
     *
16
     * @return static
17
     */
18
    public function row(Closure $callback)
19
    {
20
        $callback($row = new Row());
21
22
        $this->rows[] = $row;
23
24
        return $this;
25
    }
26
27
    /**
28
     * @return \ArrayIterator|\Traversable
29
     */
30
    public function getIterator(): \ArrayIterator
31
    {
32
        return new \ArrayIterator($this->rows);
33
    }
34
}
35