| Conditions | 5 |
| Paths | 12 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public function interpolate(string $message, array $context, array $attribute) |
||
| 31 | { |
||
| 32 | $replace = []; |
||
| 33 | $attribute = array_merge($this->attribute, $attribute); |
||
| 34 | foreach ($attribute as $key => $val) { |
||
| 35 | $replace['%' . $key . '%'] = $val; |
||
| 36 | } |
||
| 37 | $message = strtr($message, $replace); |
||
| 38 | $attachInfo = ''; |
||
| 39 | foreach ($context as $name => $value) { |
||
| 40 | $attachInfo .= $name . ' = '; |
||
| 41 | if ($value instanceof AttachValueInterface) { |
||
| 42 | $attachInfo .= $value->getLogAttach() . PHP_EOL; |
||
| 43 | } else { |
||
| 44 | $attachInfo .= DumpTrait::parameterToString($value) . PHP_EOL; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | if (strlen($attachInfo) > 0) { |
||
| 48 | return $message . PHP_EOL . $attachInfo; |
||
| 49 | } |
||
| 50 | return $message; |
||
| 51 | } |
||
| 63 |