Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
17 | 18 | public function isModelSearchable(Model $model) : bool |
|
18 | { |
||
19 | 18 | $traits = class_uses_recursive(get_class($model)); |
|
20 | |||
21 | 18 | if (!isset($traits[Searchable::class])) { |
|
22 | 2 | throw new \InvalidArgumentException(get_class($model).' does not use the searchable trait.'); |
|
23 | } |
||
24 | |||
25 | 16 | return true; |
|
26 | } |
||
28 |