Passed
Push — master ( d880c4...d9734b )
by Mike
02:44
created
src/CacheKey.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
 
58 58
     protected function getLimitClause() : string
59 59
     {
60
-        if (! property_exists($this->query, "limit")
61
-            || ! $this->query->limit
60
+        if (!property_exists($this->query, "limit")
61
+            || !$this->query->limit
62 62
         ) {
63 63
             return "";
64 64
         }
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
 
80 80
     protected function getOffsetClause() : string
81 81
     {
82
-        if (! property_exists($this->query, "offset")
83
-            || ! $this->query->offset
82
+        if (!property_exists($this->query, "offset")
83
+            || !$this->query->offset
84 84
         ) {
85 85
             return "";
86 86
         }
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
     protected function getOrderByClauses() : string
92 92
     {
93
-        if (! property_exists($this->query, "orders")
94
-            || ! $this->query->orders
93
+        if (!property_exists($this->query, "orders")
94
+            || !$this->query->orders
95 95
         ) {
96 96
             return "";
97 97
         }
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
         $orders = collect($this->query->orders);
100 100
 
101 101
         return $orders
102
-            ->reduce(function ($carry, $order) {
102
+            ->reduce(function($carry, $order) {
103 103
                 if (($order["type"] ?? "") === "Raw") {
104
-                    return $carry . "_orderByRaw_" . (new Str)->slug($order["sql"]);
104
+                    return $carry."_orderByRaw_".(new Str)->slug($order["sql"]);
105 105
                 }
106 106
 
107
-                return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"];
107
+                return $carry."_orderBy_".$order["column"]."_".$order["direction"];
108 108
             })
109 109
             ?: "";
110 110
     }
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
     {
114 114
         if (($columns === ["*"]
115 115
                 || $columns === [])
116
-            && (! property_exists($this->query, "columns")
117
-                || ! $this->query->columns)
116
+            && (!property_exists($this->query, "columns")
117
+                || !$this->query->columns)
118 118
         ) {
119 119
             return "";
120 120
         }
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
         if (property_exists($this->query, "columns")
123 123
             && $this->query->columns
124 124
         ) {
125
-            return "_" . implode("_", $this->query->columns);
125
+            return "_".implode("_", $this->query->columns);
126 126
         }
127 127
 
128
-        return "_" . implode("_", $columns);
128
+        return "_".implode("_", $columns);
129 129
     }
130 130
 
131 131
     protected function getTypeClause($where) : string
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
     protected function getValuesClause(array $where = []) : string
141 141
     {
142
-        if (! $where
142
+        if (!$where
143 143
             || in_array($where["type"], ["NotNull", "Null"])
144 144
         ) {
145 145
             return "";
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         $values = $this->getValuesFromWhere($where);
149 149
         $values = $this->getValuesFromBindings($where, $values);
150 150
 
151
-        return "_" . $values;
151
+        return "_".$values;
152 152
     }
153 153
 
154 154
     protected function getValuesFromWhere(array $where) : string
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             $this->currentBinding++;
175 175
 
176 176
             if ($where["type"] === "between") {
177
-                $values .= "_" . $this->query->bindings["where"][$this->currentBinding];
177
+                $values .= "_".$this->query->bindings["where"][$this->currentBinding];
178 178
                 $this->currentBinding++;
179 179
             }
180 180
         }
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
 
191 191
     protected function getWhereClauses(array $wheres = []) : string
192 192
     {
193
-        return "" . $this->getWheres($wheres)
194
-            ->reduce(function ($carry, $where) {
193
+        return "".$this->getWheres($wheres)
194
+            ->reduce(function($carry, $where) {
195 195
                 $value = $carry;
196 196
                 $value .= $this->getNestedClauses($where);
197 197
                 $value .= $this->getColumnClauses($where);
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
 
206 206
     protected function getNestedClauses(array $where) : string
207 207
     {
208
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
208
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
209 209
             return "";
210 210
         }
211 211
 
212
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
212
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
213 213
     }
214 214
 
215 215
     protected function getColumnClauses(array $where) : string
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
     protected function getInAndNotInClauses(array $where) : string
225 225
     {
226
-        if (! in_array($where["type"], ["In", "NotIn", "InRaw"])) {
226
+        if (!in_array($where["type"], ["In", "NotIn", "InRaw"])) {
227 227
             return "";
228 228
         }
229 229
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         $values = collect($this->query->bindings["where"][$this->currentBinding] ?? []);
233 233
         $this->currentBinding += count($where["values"]);
234 234
 
235
-        if (! is_numeric($subquery) && ! is_numeric(str_replace("_", "", $subquery))) {
235
+        if (!is_numeric($subquery) && !is_numeric(str_replace("_", "", $subquery))) {
236 236
             try {
237 237
                 $subquery = Uuid::fromBytes($subquery);
238 238
                 $values = $this->recursiveImplode([$subquery], "_");
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                 continue;
271 271
             }
272 272
 
273
-            $result .= $glue . $value;
273
+            $result .= $glue.$value;
274 274
         }
275 275
 
276 276
         return $result;
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
     protected function getRawClauses(array $where) : string
280 280
     {
281
-        if (! in_array($where["type"], ["raw"])) {
281
+        if (!in_array($where["type"], ["raw"])) {
282 282
             return "";
283 283
         }
284 284
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         $clause = "_{$where["boolean"]}";
287 287
 
288 288
         while (count($queryParts) > 1) {
289
-            $clause .= "_" . array_shift($queryParts);
289
+            $clause .= "_".array_shift($queryParts);
290 290
             $clause .= $this->query->bindings["where"][$this->currentBinding];
291 291
             $this->currentBinding++;
292 292
         }
@@ -294,10 +294,10 @@  discard block
 block discarded – undo
294 294
         $lastPart = array_shift($queryParts);
295 295
 
296 296
         if ($lastPart) {
297
-            $clause .= "_" . $lastPart;
297
+            $clause .= "_".$lastPart;
298 298
         }
299 299
 
300
-        return "-" . str_replace(" ", "_", $clause);
300
+        return "-".str_replace(" ", "_", $clause);
301 301
     }
302 302
 
303 303
     protected function getOtherClauses(array $where) : string
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
             return "";
334 334
         }
335 335
 
336
-        return $eagerLoads->keys()->reduce(function ($carry, $related) {
337
-            if (! method_exists($this->model, $related)) {
336
+        return $eagerLoads->keys()->reduce(function($carry, $related) {
337
+            if (!method_exists($this->model, $related)) {
338 338
                 return "{$carry}-{$related}";
339 339
             }
340 340
 
Please login to merge, or discard this patch.