Passed
Pull Request — master (#343)
by
unknown
04:21 queued 43s
created
src/CacheKey.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 
59 59
     protected function getLimitClause() : string
60 60
     {
61
-        if (! property_exists($this->query, "limit")
62
-            || ! $this->query->limit
61
+        if (!property_exists($this->query, "limit")
62
+            || !$this->query->limit
63 63
         ) {
64 64
             return "";
65 65
         }
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 
81 81
     protected function getOffsetClause() : string
82 82
     {
83
-        if (! property_exists($this->query, "offset")
84
-            || ! $this->query->offset
83
+        if (!property_exists($this->query, "offset")
84
+            || !$this->query->offset
85 85
         ) {
86 86
             return "";
87 87
         }
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
 
92 92
     protected function getOrderByClauses() : string
93 93
     {
94
-        if (! property_exists($this->query, "orders")
95
-            || ! $this->query->orders
94
+        if (!property_exists($this->query, "orders")
95
+            || !$this->query->orders
96 96
         ) {
97 97
             return "";
98 98
         }
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $orders = collect($this->query->orders);
101 101
 
102 102
         return $orders
103
-            ->reduce(function ($carry, $order) {
103
+            ->reduce(function($carry, $order) {
104 104
                 if (($order["type"] ?? "") === "Raw") {
105
-                    return $carry . "_orderByRaw_" . (new Str)->slug($order["sql"]);
105
+                    return $carry."_orderByRaw_".(new Str)->slug($order["sql"]);
106 106
                 }
107 107
 
108
-                return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"];
108
+                return $carry."_orderBy_".$order["column"]."_".$order["direction"];
109 109
             })
110 110
             ?: "";
111 111
     }
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
     {
115 115
         if (($columns === ["*"]
116 116
                 || $columns === [])
117
-            && (! property_exists($this->query, "columns")
118
-                || ! $this->query->columns)
117
+            && (!property_exists($this->query, "columns")
118
+                || !$this->query->columns)
119 119
         ) {
120 120
             return "";
121 121
         }
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
         if (property_exists($this->query, "columns")
124 124
             && $this->query->columns
125 125
         ) {
126
-            return "_" . implode("_", $this->query->columns);
126
+            return "_".implode("_", $this->query->columns);
127 127
         }
128 128
 
129
-        return "_" . implode("_", $columns);
129
+        return "_".implode("_", $columns);
130 130
     }
131 131
 
132 132
     protected function getTypeClause($where) : string
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     protected function getValuesClause(array $where = []) : string
142 142
     {
143
-        if (! $where
143
+        if (!$where
144 144
             || in_array($where["type"], ["NotNull", "Null"])
145 145
         ) {
146 146
             return "";
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $values = $this->getValuesFromWhere($where);
150 150
         $values = $this->getValuesFromBindings($where, $values);
151 151
 
152
-        return "_" . $values;
152
+        return "_".$values;
153 153
     }
154 154
 
155 155
     protected function getValuesFromWhere(array $where) : string
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             $this->currentBinding++;
180 180
 
181 181
             if ($where["type"] === "between") {
182
-                $values .= "_" . $this->query->bindings["where"][$this->currentBinding];
182
+                $values .= "_".$this->query->bindings["where"][$this->currentBinding];
183 183
                 $this->currentBinding++;
184 184
             }
185 185
         }
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 
196 196
     protected function getWhereClauses(array $wheres = []) : string
197 197
     {
198
-        return "" . $this->getWheres($wheres)
199
-            ->reduce(function ($carry, $where) {
198
+        return "".$this->getWheres($wheres)
199
+            ->reduce(function($carry, $where) {
200 200
                 $value = $carry;
201 201
                 $value .= $this->getNestedClauses($where);
202 202
                 $value .= $this->getColumnClauses($where);
@@ -210,11 +210,11 @@  discard block
 block discarded – undo
210 210
 
211 211
     protected function getNestedClauses(array $where) : string
212 212
     {
213
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
213
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
214 214
             return "";
215 215
         }
216 216
 
217
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
217
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
218 218
     }
219 219
 
220 220
     protected function getColumnClauses(array $where) : string
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
     protected function getInAndNotInClauses(array $where) : string
230 230
     {
231
-        if (! in_array($where["type"], ["In", "NotIn", "InRaw"])) {
231
+        if (!in_array($where["type"], ["In", "NotIn", "InRaw"])) {
232 232
             return "";
233 233
         }
234 234
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             $this->currentBinding += count($where["values"]);
241 241
         }
242 242
 
243
-        if (! is_numeric($subquery) && ! is_numeric(str_replace("_", "", $subquery))) {
243
+        if (!is_numeric($subquery) && !is_numeric(str_replace("_", "", $subquery))) {
244 244
             try {
245 245
                 $subquery = Uuid::fromBytes($subquery);
246 246
                 $values = $this->recursiveImplode([$subquery], "_");
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
                 continue;
279 279
             }
280 280
 
281
-            $result .= $glue . $value;
281
+            $result .= $glue.$value;
282 282
         }
283 283
 
284 284
         return $result;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
     protected function getRawClauses(array $where) : string
288 288
     {
289
-        if (! in_array($where["type"], ["raw"])) {
289
+        if (!in_array($where["type"], ["raw"])) {
290 290
             return "";
291 291
         }
292 292
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
         $clause = "_{$where["boolean"]}";
295 295
 
296 296
         while (count($queryParts) > 1) {
297
-            $clause .= "_" . array_shift($queryParts);
297
+            $clause .= "_".array_shift($queryParts);
298 298
             $clause .= $this->query->bindings["where"][$this->currentBinding];
299 299
             $this->currentBinding++;
300 300
         }
@@ -302,10 +302,10 @@  discard block
 block discarded – undo
302 302
         $lastPart = array_shift($queryParts);
303 303
 
304 304
         if ($lastPart) {
305
-            $clause .= "_" . $lastPart;
305
+            $clause .= "_".$lastPart;
306 306
         }
307 307
 
308
-        return "-" . str_replace(" ", "_", $clause);
308
+        return "-".str_replace(" ", "_", $clause);
309 309
     }
310 310
 
311 311
     protected function getOtherClauses(array $where) : string
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
             return "";
342 342
         }
343 343
 
344
-        return $eagerLoads->keys()->reduce(function ($carry, $related) {
345
-            if (! method_exists($this->model, $related)) {
344
+        return $eagerLoads->keys()->reduce(function($carry, $related) {
345
+            if (!method_exists($this->model, $related)) {
346 346
                 return "{$carry}-{$related}";
347 347
             }
348 348
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
     protected function getBindingsSlug() : string
358 358
     {
359
-        if (! method_exists($this->model, 'query')) {
359
+        if (!method_exists($this->model, 'query')) {
360 360
             return '';
361 361
         }
362 362
         
Please login to merge, or discard this patch.