| Conditions | 5 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 8 | public function unpack(string $content): array |
|
| 29 | { |
||
| 30 | 8 | $lines = explode($this->delimitLines, $content); |
|
| 31 | 8 | $records = []; |
|
| 32 | 8 | if (false !== $lines) { |
|
| 33 | 8 | foreach ($lines as &$line) { |
|
| 34 | 8 | if (empty($line)) { |
|
| 35 | 8 | continue; |
|
| 36 | } |
||
| 37 | |||
| 38 | 8 | $items = explode($this->delimitElements, strval($line)); |
|
| 39 | 8 | if (false !== $items) { |
|
| 40 | 8 | $records[] = array_map([$this, 'unescapeNl'], $items); |
|
| 41 | } |
||
| 42 | } |
||
| 43 | } |
||
| 44 | 8 | return $records; |
|
| 45 | } |
||
| 59 |