| Conditions | 6 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function handler(mixed $message, array $context = []): string |
||
| 19 | { |
||
| 20 | if (is_string($message)) { |
||
| 21 | $replace = []; |
||
| 22 | foreach ($context as $key => $value) { |
||
| 23 | if (is_string($value) || is_numeric($value) || method_exists($value, '__toString')) { |
||
| 24 | $replace['{' . $key . '}'] = $value; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | $message = sprintf('%s', strtr($message, $replace)); |
||
| 28 | } |
||
| 29 | |||
| 30 | return parent::handler($message, $context); |
||
| 31 | } |
||
| 33 |