| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function render(array $source, array $arguments) |
||
| 30 | { |
||
| 31 | $text = end($source); |
||
| 32 | |||
| 33 | if ($arguments) { |
||
|
|
|||
| 34 | $placeholders = array_map([$this, 'keyToPlaceholder'], array_keys($arguments)); |
||
| 35 | $pairs = array_combine($placeholders, $arguments); |
||
| 36 | $text = strtr($text, $pairs); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $text; |
||
| 40 | } |
||
| 41 | |||
| 53 |
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.