| Conditions | 4 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function getDataTransformer(): ?\Closure |
||
| 31 | { |
||
| 32 | 1 | return function ($data) { |
|
| 33 | if ($data === null) { |
||
| 34 | 1 | return ''; |
|
| 35 | 1 | } |
|
| 36 | 1 | ||
| 37 | if ($data instanceof Collection) { |
||
| 38 | $data = $data->toArray(); |
||
| 39 | 1 | } |
|
| 40 | 1 | ||
| 41 | if ($data instanceof \Iterator) { |
||
| 42 | $data = iterator_to_array($data); |
||
| 43 | 1 | } |
|
| 44 | 1 | ||
| 45 | return implode($this->getOption('glue'), $data); |
||
| 46 | }; |
||
| 49 |