Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 2 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
37 | public function encode($value, $depth, array $options, callable $encode) |
||
38 | { |
||
39 | $reflection = new ReflectionClosure($value); |
||
40 | $variables = $reflection->getStaticVariables(); |
||
41 | $config = strrpos($variables['config'], '.php') === false |
||
42 | ? $variables['config'] . '.php' |
||
43 | : $variables['config']; |
||
44 | |||
45 | return str_replace( |
||
46 | ['$config'], |
||
47 | ["'$config'"], |
||
48 | substr( |
||
49 | $reflection->getCode(), |
||
50 | 16 |
||
51 | ), |
||
55 |