| Conditions | 2 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 22 | public function handle(string $input): string |
|
| 18 | { |
||
| 19 | 22 | return preg_replace_callback( |
|
| 20 | 22 | '/(%)(.+)(%)/', |
|
| 21 | 22 | function ($matches) { |
|
| 22 | 1 | if (\defined($matches[2])) { |
|
| 23 | 1 | return constant($matches[2]); |
|
| 24 | } |
||
| 25 | 1 | return $matches[1] . $matches[2] . $matches[3]; |
|
| 26 | 22 | }, |
|
| 27 | 22 | $input |
|
| 28 | 22 | ) ?? ''; |
|
| 29 | } |
||
| 31 |