Manager::getIterator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
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