| Conditions | 5 |
| Paths | 6 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | 5 | public function write(Buffer $buffer) |
|
| 41 | { |
||
| 42 | 5 | $lines = []; |
|
| 43 | 5 | foreach ($this->data as $var => $value) { |
|
| 44 | 2 | if (is_array($value)) { |
|
| 45 | 2 | $_tmpString = ''; |
|
| 46 | 2 | foreach ($value as $key => $val) { |
|
| 47 | 2 | $_tmpString .= sprintf("%s('%s'\n)", $key, $val); |
|
| 48 | } |
||
| 49 | 2 | $value = $_tmpString; |
|
| 50 | } |
||
| 51 | 2 | $lines[] = sprintf('%s:%s', $var, $value); |
|
| 52 | } |
||
| 53 | |||
| 54 | 5 | if ($lines) { |
|
| 55 | 2 | $data = implode('/', $lines); |
|
| 56 | 2 | $this->dataCount = mb_strlen($data); |
|
| 57 | 2 | parent::write($buffer); |
|
| 58 | 2 | $buffer->writeString($data); |
|
| 59 | } |
||
| 62 |