| Total Complexity | 6 |
| Total Lines | 39 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class TemplateFormatter implements Formatter |
||
| 11 | { |
||
| 12 | use PreparesValue; |
||
| 13 | |||
| 14 | 4 | public function __construct(protected readonly bool $includeTraceback = true) |
|
| 16 | 4 | } |
|
| 17 | |||
| 18 | 4 | public function format(string $message, ?array $context): string |
|
| 25 | } |
||
| 26 | |||
| 27 | 4 | protected function interpolate(string $template, array $context): string |
|
| 51 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.