| Total Complexity | 3 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 8 | trait HasRelationships |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | */ |
||
| 13 | protected $relationships = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Scope Plan search results to only plans that are 'public'. |
||
| 17 | * |
||
| 18 | * @param array $relationships |
||
| 19 | * @return $this |
||
| 20 | */ |
||
| 21 | public function withRelationships(array $relationships = []): self |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Retrieve a Query builder. |
||
| 30 | * |
||
| 31 | * @return Builder |
||
| 32 | */ |
||
| 33 | abstract protected function newBuilder(): Builder; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Retrieve a Query builder. |
||
| 37 | * |
||
| 38 | * @return Builder |
||
| 39 | */ |
||
| 40 | protected function builder(): Builder |
||
| 51 |
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.