Passed
Push — master ( b5f4ee...d62290 )
by Malte
05:36 queued 01:04
created
src/IMAP/Query/WhereQuery.php 2 patches
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -76,18 +76,18 @@  discard block
 block discarded – undo
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
-        if (strpos(strtolower($name), "where") === false){
84
+        if (strpos(strtolower($name), "where") === false) {
85 85
             $method = 'where'.ucfirst($name);
86
-        }else{
86
+        } else {
87 87
             $method = lcfirst($name);
88 88
         }
89 89
 
90
-        if(method_exists($this, $method) === true){
90
+        if (method_exists($this, $method) === true) {
91 91
             return call_user_func_array([$that, $method], $arguments);
92 92
         }
93 93
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         if (substr($criteria, 0, 6) === "CUSTOM") {
108 108
             return substr($criteria, 6);
109 109
         }
110
-        if(in_array($criteria, $this->available_criteria) === false) {
110
+        if (in_array($criteria, $this->available_criteria) === false) {
111 111
             throw new InvalidWhereQueryCriteriaException();
112 112
         }
113 113
 
@@ -122,20 +122,20 @@  discard block
 block discarded – undo
122 122
      * @throws InvalidWhereQueryCriteriaException
123 123
      */
124 124
     public function where($criteria, $value = null) {
125
-        if(is_array($criteria)){
126
-            foreach($criteria as $key => $value){
127
-                if(is_numeric($key)){
125
+        if (is_array($criteria)) {
126
+            foreach ($criteria as $key => $value) {
127
+                if (is_numeric($key)) {
128 128
                     return $this->where($value);
129 129
                 }
130 130
                 return $this->where($key, $value);
131 131
             }
132
-        }else{
132
+        } else {
133 133
             $criteria = $this->validate_criteria($criteria);
134 134
             $value = $this->parse_value($value);
135 135
 
136
-            if($value === null || $value === ''){
136
+            if ($value === null || $value === '') {
137 137
                 $this->query->push([$criteria]);
138
-            }else{
138
+            } else {
139 139
                 $this->query->push([$criteria, $value]);
140 140
             }
141 141
         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function orWhere(\Closure $closure = null) {
152 152
         $this->query->push(['OR']);
153
-        if($closure !== null) $closure($this);
153
+        if ($closure !== null) $closure($this);
154 154
 
155 155
         return $this;
156 156
     }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
      */
163 163
     public function andWhere(\Closure $closure = null) {
164 164
         $this->query->push(['AND']);
165
-        if($closure !== null) $closure($this);
165
+        if ($closure !== null) $closure($this);
166 166
 
167 167
         return $this;
168 168
     }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
      * @return WhereQuery
403 403
      * @throws InvalidWhereQueryCriteriaException
404 404
      */
405
-    public function whereNoXSpam(){
405
+    public function whereNoXSpam() {
406 406
         return $this->where("X-Spam-Flag NO");
407 407
     }
408 408
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
      * @return WhereQuery
411 411
      * @throws InvalidWhereQueryCriteriaException
412 412
      */
413
-    public function whereIsXSpam(){
413
+    public function whereIsXSpam() {
414 414
         return $this->where("X-Spam-Flag YES");
415 415
     }
416 416
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
      * @return WhereQuery
421 421
      * @throws InvalidWhereQueryCriteriaException
422 422
      */
423
-    public function whereLanguage($country_code){
423
+    public function whereLanguage($country_code) {
424 424
         return $this->where("Content-Language $country_code");
425 425
     }
426 426
 }
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         if (strpos(strtolower($name), "where") === false){
85 85
             $method = 'where'.ucfirst($name);
86
-        }else{
86
+        } else{
87 87
             $method = lcfirst($name);
88 88
         }
89 89
 
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
                 }
130 130
                 return $this->where($key, $value);
131 131
             }
132
-        }else{
132
+        } else{
133 133
             $criteria = $this->validate_criteria($criteria);
134 134
             $value = $this->parse_value($value);
135 135
 
136 136
             if($value === null || $value === ''){
137 137
                 $this->query->push([$criteria]);
138
-            }else{
138
+            } else{
139 139
                 $this->query->push([$criteria, $value]);
140 140
             }
141 141
         }
@@ -150,7 +150,9 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function orWhere(\Closure $closure = null) {
152 152
         $this->query->push(['OR']);
153
-        if($closure !== null) $closure($this);
153
+        if($closure !== null) {
154
+            $closure($this);
155
+        }
154 156
 
155 157
         return $this;
156 158
     }
@@ -162,7 +164,9 @@  discard block
 block discarded – undo
162 164
      */
163 165
     public function andWhere(\Closure $closure = null) {
164 166
         $this->query->push(['AND']);
165
-        if($closure !== null) $closure($this);
167
+        if($closure !== null) {
168
+            $closure($this);
169
+        }
166 170
 
167 171
         return $this;
168 172
     }
Please login to merge, or discard this patch.