| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function get($key, $locale = null, $default = null) |
||
| 16 | { |
||
| 17 | $this->fetch(); |
||
| 18 | |||
| 19 | if (! isset($this->items[$key])) { |
||
| 20 | return $default; |
||
| 21 | } |
||
| 22 | |||
| 23 | if (is_array($this->items[$key])) { |
||
| 24 | if ($this->items[$key]['value'] == null) { |
||
| 25 | return $default; |
||
| 26 | } |
||
| 27 | |||
| 28 | return $this->items[$key]['value']; |
||
| 29 | } |
||
| 30 | |||
| 31 | return $this->items[$key]; |
||
| 32 | } |
||
| 61 |
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.