| Total Complexity | 4 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | abstract class Model extends BaseModel |
||
| 13 | { |
||
| 14 | use AutoFilter; |
||
| 15 | use AutoSort; |
||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $keyType = 'string'; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string[] |
||
| 23 | */ |
||
| 24 | protected $searchableColumns = ['id', 'name']; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Model constructor. |
||
| 28 | * |
||
| 29 | * @param array $attributes |
||
| 30 | */ |
||
| 31 | public function __construct(array $attributes = []) |
||
| 32 | { |
||
| 33 | parent::__construct($attributes); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param $query |
||
| 38 | * @param $keyword |
||
| 39 | */ |
||
| 40 | public function scopeSearch($query, $keyword) |
||
| 44 | } |
||
| 45 | } |
||
| 47 |
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.