Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | 3 | public function format(string $message, array $parameters, string $locale): string |
|
12 | { |
||
13 | 3 | $replacements = []; |
|
14 | /** @var mixed $value */ |
||
15 | 3 | foreach ($parameters as $key => $value) { |
|
16 | 3 | if (is_scalar($value)) { |
|
17 | 2 | $replacements['{' . $key . '}'] = $value; |
|
18 | } |
||
19 | } |
||
20 | 3 | return strtr($message, $replacements); |
|
21 | } |
||
23 |