| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.4326 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 6 | public function serialise($input) |
|
| 28 | { |
||
| 29 | 6 | $writer = Writer::createFromString(''); |
|
| 30 | |||
| 31 | 6 | if (is_array(reset($input))) { |
|
| 32 | $writer->insertOne(array_keys(reset($input))); |
||
| 33 | } else { |
||
| 34 | 6 | $writer->insertOne(array_keys($input)); |
|
| 35 | } |
||
| 36 | |||
| 37 | 6 | if (is_array(reset($input))) { |
|
| 38 | $writer->insertAll($input); |
||
| 39 | } else { |
||
| 40 | 6 | $writer->insertOne($input); |
|
| 41 | } |
||
| 42 | |||
| 43 | 6 | return $writer->__toString(); |
|
| 44 | } |
||
| 45 | } |
||
| 46 |