@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | |
77 | 77 | $name = Str::camel($name); |
78 | 78 | |
79 | - if(strtolower(substr($name, 0, 3)) === 'not') { |
|
79 | + if (strtolower(substr($name, 0, 3)) === 'not') { |
|
80 | 80 | $that = $that->whereNot(); |
81 | 81 | $name = substr($name, 3); |
82 | 82 | } |
83 | 83 | |
84 | 84 | $method = 'where'.ucfirst($name); |
85 | - if(method_exists($this, $method) === true){ |
|
85 | + if (method_exists($this, $method) === true) { |
|
86 | 86 | return call_user_func_array([$that, $method], $arguments); |
87 | 87 | } |
88 | 88 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if (substr($criteria, 0, 6) === "CUSTOM") { |
103 | 103 | return substr($criteria, 6); |
104 | 104 | } |
105 | - if(in_array($criteria, $this->available_criteria) === false) { |
|
105 | + if (in_array($criteria, $this->available_criteria) === false) { |
|
106 | 106 | throw new InvalidWhereQueryCriteriaException(); |
107 | 107 | } |
108 | 108 | |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | * @throws InvalidWhereQueryCriteriaException |
118 | 118 | */ |
119 | 119 | public function where($criteria, $value = null) { |
120 | - if(is_array($criteria)){ |
|
121 | - foreach($criteria as $key => $value){ |
|
122 | - if(is_numeric($key)){ |
|
120 | + if (is_array($criteria)) { |
|
121 | + foreach ($criteria as $key => $value) { |
|
122 | + if (is_numeric($key)) { |
|
123 | 123 | return $this->where($value); |
124 | 124 | } |
125 | 125 | return $this->where($key, $value); |
126 | 126 | } |
127 | - }else{ |
|
127 | + } else { |
|
128 | 128 | $criteria = $this->validate_criteria($criteria); |
129 | 129 | $value = $this->parse_value($value); |
130 | 130 | |
131 | - if($value === null || $value === ''){ |
|
131 | + if ($value === null || $value === '') { |
|
132 | 132 | $this->query->push([$criteria]); |
133 | - }else{ |
|
133 | + } else { |
|
134 | 134 | $this->query->push([$criteria, $value]); |
135 | 135 | } |
136 | 136 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function orWhere(\Closure $closure = null) { |
147 | 147 | $this->query->push(['OR']); |
148 | - if($closure !== null) $closure($this); |
|
148 | + if ($closure !== null) $closure($this); |
|
149 | 149 | |
150 | 150 | return $this; |
151 | 151 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function andWhere(\Closure $closure = null) { |
159 | 159 | $this->query->push(['AND']); |
160 | - if($closure !== null) $closure($this); |
|
160 | + if ($closure !== null) $closure($this); |
|
161 | 161 | |
162 | 162 | return $this; |
163 | 163 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @return WhereQuery |
398 | 398 | * @throws InvalidWhereQueryCriteriaException |
399 | 399 | */ |
400 | - public function whereNoXSpam(){ |
|
400 | + public function whereNoXSpam() { |
|
401 | 401 | return $this->where("X-Spam-Flag NO"); |
402 | 402 | } |
403 | 403 | |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | * @return WhereQuery |
406 | 406 | * @throws InvalidWhereQueryCriteriaException |
407 | 407 | */ |
408 | - public function whereIsXSpam(){ |
|
408 | + public function whereIsXSpam() { |
|
409 | 409 | return $this->where("X-Spam-Flag YES"); |
410 | 410 | } |
411 | 411 | |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @return WhereQuery |
416 | 416 | * @throws InvalidWhereQueryCriteriaException |
417 | 417 | */ |
418 | - public function whereLanguage($country_code){ |
|
418 | + public function whereLanguage($country_code) { |
|
419 | 419 | return $this->where("Content-Language $country_code"); |
420 | 420 | } |
421 | 421 | } |
@@ -124,13 +124,13 @@ discard block |
||
124 | 124 | } |
125 | 125 | return $this->where($key, $value); |
126 | 126 | } |
127 | - }else{ |
|
127 | + } else{ |
|
128 | 128 | $criteria = $this->validate_criteria($criteria); |
129 | 129 | $value = $this->parse_value($value); |
130 | 130 | |
131 | 131 | if($value === null || $value === ''){ |
132 | 132 | $this->query->push([$criteria]); |
133 | - }else{ |
|
133 | + } else{ |
|
134 | 134 | $this->query->push([$criteria, $value]); |
135 | 135 | } |
136 | 136 | } |
@@ -145,7 +145,9 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function orWhere(\Closure $closure = null) { |
147 | 147 | $this->query->push(['OR']); |
148 | - if($closure !== null) $closure($this); |
|
148 | + if($closure !== null) { |
|
149 | + $closure($this); |
|
150 | + } |
|
149 | 151 | |
150 | 152 | return $this; |
151 | 153 | } |
@@ -157,7 +159,9 @@ discard block |
||
157 | 159 | */ |
158 | 160 | public function andWhere(\Closure $closure = null) { |
159 | 161 | $this->query->push(['AND']); |
160 | - if($closure !== null) $closure($this); |
|
162 | + if($closure !== null) { |
|
163 | + $closure($this); |
|
164 | + } |
|
161 | 165 | |
162 | 166 | return $this; |
163 | 167 | } |