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