| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | private function fetch() |
||
| 40 | { |
||
| 41 | if ($this->items) { |
||
|
|
|||
| 42 | return; |
||
| 43 | } |
||
| 44 | |||
| 45 | $config_values = static::configValues(); |
||
| 46 | |||
| 47 | $database_values = Schema::hasTable((new Setting)->getTable()) |
||
| 48 | ? Setting::all()->pluck('value', 'key')->toArray() |
||
| 49 | : []; |
||
| 50 | |||
| 51 | $this->items = array_merge($config_values, $database_values); |
||
| 52 | } |
||
| 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.