| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | public static function psr2InlineVarExport($var): string |
||
| 40 | { |
||
| 41 | if (is_array($var)) { |
||
| 42 | $indexed = array_keys($var) === range(0, count($var) - 1); |
||
| 43 | $r = []; |
||
| 44 | foreach ($var as $key => $value) { |
||
| 45 | $r[] = ($indexed ? '' : self::psr2InlineVarExport($key) . ' => ') |
||
| 46 | . self::psr2InlineVarExport($value); |
||
| 47 | } |
||
| 48 | return '[' . implode(',', $r) . ']'; |
||
| 49 | } |
||
| 50 | return var_export($var, true); |
||
| 51 | } |
||
| 53 |