Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
27 | 70 | private static function interpolate($message, array $context = array()): string |
|
28 | { |
||
29 | 70 | $replace = array(); |
|
30 | |||
31 | 70 | if ($context !== null) { |
|
32 | 70 | foreach ($context as $key => $val) { |
|
33 | 55 | $replace['{' . $key . '}'] = $val; |
|
34 | } |
||
35 | } |
||
36 | |||
37 | 70 | return strtr($message, $replace); |
|
38 | } |
||
39 | } |
||
40 |