Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 1.0007 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | 10 | public function encode($value, $depth, array $options, callable $encode) |
|
38 | { |
||
39 | 10 | $reflection = new ReflectionClosure($value); |
|
40 | 10 | $variables = $reflection->getStaticVariables(); |
|
41 | 10 | $key = $variables['key']; |
|
42 | 10 | $default = $variables['default'] ?? null; |
|
43 | |||
44 | 10 | return str_replace( |
|
45 | 10 | ['$key', '$default'], |
|
46 | 10 | ["'$key'", Helper::exportVar($default)], |
|
47 | substr( |
||
48 | 10 | $reflection->getCode(), |
|
49 | 10 | 16 |
|
50 | ), |
||
54 |