Completed
Push — master ( 4e3894...ff75c7 )
by Malte
06:40
created
src/IMAP/Query/WhereQuery.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -76,13 +76,13 @@  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 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
 block discarded – undo
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,21 +117,21 @@  discard block
 block discarded – undo
117 117
      * @throws InvalidWhereQueryCriteriaException
118 118
      */
119 119
     public function where($criteria, $value = null) {
120
-        if(is_array($criteria)){
121
-            foreach($criteria as $arguments){
122
-                if(count($arguments) == 1){
120
+        if (is_array($criteria)) {
121
+            foreach ($criteria as $arguments) {
122
+                if (count($arguments) == 1) {
123 123
                     $this->where($arguments[0]);
124
-                }elseif(count($arguments) == 2){
124
+                }elseif (count($arguments) == 2) {
125 125
                     $this->where($arguments[0], $arguments[1]);
126 126
                 }
127 127
             }
128
-        }else{
128
+        } else {
129 129
             $criteria = $this->validate_criteria($criteria);
130 130
             $value = $this->parse_value($value);
131 131
 
132
-            if($value === null || $value === ''){
132
+            if ($value === null || $value === '') {
133 133
                 $this->query->push([$criteria]);
134
-            }else{
134
+            } else {
135 135
                 $this->query->push([$criteria, $value]);
136 136
             }
137 137
         }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     public function orWhere(\Closure $closure = null) {
148 148
         $this->query->push(['OR']);
149
-        if($closure !== null) $closure($this);
149
+        if ($closure !== null) $closure($this);
150 150
 
151 151
         return $this;
152 152
     }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function andWhere(\Closure $closure = null) {
160 160
         $this->query->push(['AND']);
161
-        if($closure !== null) $closure($this);
161
+        if ($closure !== null) $closure($this);
162 162
 
163 163
         return $this;
164 164
     }
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
      * @return WhereQuery
399 399
      * @throws InvalidWhereQueryCriteriaException
400 400
      */
401
-    public function whereNoXSpam(){
401
+    public function whereNoXSpam() {
402 402
         return $this->where("X-Spam-Flag NO");
403 403
     }
404 404
 
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
      * @return WhereQuery
407 407
      * @throws InvalidWhereQueryCriteriaException
408 408
      */
409
-    public function whereIsXSpam(){
409
+    public function whereIsXSpam() {
410 410
         return $this->where("X-Spam-Flag YES");
411 411
     }
412 412
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
      * @return WhereQuery
417 417
      * @throws InvalidWhereQueryCriteriaException
418 418
      */
419
-    public function whereLanguage($country_code){
419
+    public function whereLanguage($country_code) {
420 420
         return $this->where("Content-Language $country_code");
421 421
     }
422 422
 }
Please login to merge, or discard this patch.