Total Complexity | 7 |
Total Lines | 68 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | class FileTable |
||
8 | { |
||
9 | /** |
||
10 | * @var int |
||
11 | */ |
||
12 | private $errors = 0; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $table; |
||
18 | |||
19 | 14 | public function __construct(array $firstRow) |
|
20 | { |
||
21 | 14 | $this->addRow($firstRow); |
|
22 | 14 | } |
|
23 | |||
24 | /** |
||
25 | * @param array $row |
||
26 | * |
||
27 | * @return $this |
||
28 | */ |
||
29 | 14 | public function addRow(array $row) |
|
30 | { |
||
31 | 14 | $this->table[] = $row; |
|
32 | |||
33 | 14 | return $this; |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param mixed $falsyIsError |
||
38 | * @param array $row |
||
39 | * |
||
40 | * @return $this |
||
41 | */ |
||
42 | 9 | public function addFlaggedRow($falsyIsError, array $row) |
|
43 | { |
||
44 | 9 | if (!$falsyIsError) { |
|
45 | 8 | $this->errors++; |
|
46 | } |
||
47 | |||
48 | 9 | return $this->addRow($row); |
|
49 | } |
||
50 | |||
51 | /** |
||
52 | * @param array $row |
||
53 | * |
||
54 | * @return $this |
||
55 | */ |
||
56 | 8 | public function addErrorRow(array $row) |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return int |
||
63 | */ |
||
64 | 13 | public function getErrors() |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * @return array |
||
71 | */ |
||
72 | 13 | public function toArray() |
|
75 | } |
||
76 | } |
||
77 |