| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 1 | protected function transform(array $context): string |
|
| 28 | { |
||
| 29 | 1 | $result = ''; |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @psalm-suppress MixedAssignment |
||
| 33 | * |
||
| 34 | * $value types are exhaustively checked |
||
| 35 | */ |
||
| 36 | 1 | foreach ($context as $key => $value) { |
|
| 37 | 1 | $result .= " [{$key}] => " . $this->prepare($value, $this->includeTraceback, ' ') . "\n"; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | return $result; |
|
| 41 | } |
||
| 43 |
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.