1 | <?php |
||
11 | class Segment |
||
12 | { |
||
13 | private $queryParts = array(); |
||
14 | |||
15 | /** |
||
16 | * builds the query and returns it as a string |
||
17 | * |
||
18 | * @return string |
||
19 | */ |
||
20 | public function getQuery() |
||
28 | |||
29 | /** |
||
30 | * starts segment query with operator |
||
31 | * |
||
32 | * @param Operator $operator |
||
33 | * @return self |
||
34 | */ |
||
35 | public function where(Operator $operator) |
||
42 | |||
43 | /** |
||
44 | * adds new operator using with AND. Starts new segment query if was not started yet |
||
45 | * |
||
46 | * @param Operator $operator |
||
47 | * @return self |
||
48 | */ |
||
49 | public function andWhere(Operator $operator) |
||
53 | |||
54 | /** |
||
55 | * adds new operator using with OR. Starts new segment query if was not started yet |
||
56 | * |
||
57 | * @param Operator $operator |
||
58 | * @return self |
||
59 | */ |
||
60 | public function orWhere(Operator $operator) |
||
64 | |||
65 | private function append(Operator $operator, $sign) |
||
75 | } |
||
76 |
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.