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