Conditions | 5 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | 11 | public function writeRow($row) |
|
44 | { |
||
45 | 11 | if (!is_array($row) && !$row instanceof \Traversable) { |
|
46 | 1 | throw new \InvalidArgumentException('Every value of $rows should be an array or an instance of \Traversable.'); |
|
47 | } |
||
48 | |||
49 | 10 | $separator = ''; |
|
50 | |||
51 | 10 | foreach ($row as $cell) { |
|
52 | 10 | fwrite($this->out, $separator . $this->formatCell($cell)); |
|
53 | |||
54 | 10 | if ('' === $separator) { |
|
55 | 10 | $separator = ','; |
|
56 | 10 | } |
|
57 | 10 | } |
|
58 | |||
59 | 10 | fwrite($this->out, "\r\n"); |
|
60 | 10 | } |
|
61 | |||
80 |