Conditions | 4 |
Paths | 8 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
16 | public function buildQueryString(Builder $builder): array |
||
17 | { |
||
18 | $queryString = []; |
||
19 | |||
20 | // Add the where clauses to the query string. |
||
21 | foreach ($builder->getWheres() as $where) { |
||
22 | $queryString = $this->addWhereClause($where, $queryString); |
||
23 | } |
||
24 | |||
25 | // Add the order. |
||
26 | if ($builder->getOrder()) { |
||
27 | $queryString[config('api-database.query_string_keys.order', 'order')] = $builder->getOrder(); |
||
28 | } |
||
29 | |||
30 | // Add the limit. |
||
31 | if ($builder->getLimit()) { |
||
|
|||
32 | $queryString[config('api-database.query_string_keys.limit', 'limit')] = $builder->getLimit(); |
||
33 | } |
||
34 | |||
35 | return $queryString; |
||
36 | } |
||
37 | |||
58 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: