Total Complexity | 8 |
Total Lines | 58 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class Builder extends ComposhipsBuilder |
||
13 | { |
||
14 | /** |
||
15 | * The maximum number of records to return per group. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | public $groupLimit; |
||
20 | |||
21 | /** |
||
22 | * Add a "group limit" clause to the query. |
||
23 | * |
||
24 | * @param int $value |
||
25 | * @param string $column |
||
26 | * @return $this |
||
27 | */ |
||
28 | 32 | public function groupLimit($value, $column) |
|
29 | { |
||
30 | 32 | if ($value >= 0) { |
|
31 | 32 | $this->groupLimit = compact('value', 'column'); |
|
32 | } |
||
33 | |||
34 | 32 | return $this; |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * Execute the query as a "select" statement. |
||
39 | * |
||
40 | * @param array $columns |
||
41 | * @return \Illuminate\Support\Collection |
||
42 | */ |
||
43 | 84 | public function get($columns = ['*']) |
|
70 | } |
||
71 | } |
||
72 |
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.