Passed
Pull Request — master (#228)
by
unknown
02:41
created
src/CacheKey.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     protected function getLimitClause() : string
57 57
     {
58
-        if (! $this->query->limit) {
58
+        if (!$this->query->limit) {
59 59
             return "";
60 60
         }
61 61
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
     protected function getOffsetClause() : string
77 77
     {
78
-        if (! $this->query->offset) {
78
+        if (!$this->query->offset) {
79 79
             return "";
80 80
         }
81 81
 
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
         $orders = collect($this->query->orders);
88 88
 
89 89
         return $orders
90
-            ->reduce(function ($carry, $order) {
90
+            ->reduce(function($carry, $order) {
91 91
                 if (($order["type"] ?? "") === "Raw") {
92
-                    return $carry . "_orderByRaw_" . Str::slug($order["sql"]);
92
+                    return $carry."_orderByRaw_".Str::slug($order["sql"]);
93 93
                 }
94 94
 
95
-                return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"];
95
+                return $carry."_orderBy_".$order["column"]."_".$order["direction"];
96 96
             })
97 97
             ?: "";
98 98
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             return "";
104 104
         }
105 105
 
106
-        return "_" . implode("_", $columns);
106
+        return "_".implode("_", $columns);
107 107
     }
108 108
 
109 109
     protected function getTypeClause($where) : string
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $values = $this->getValuesFromWhere($where);
125 125
         $values = $this->getValuesFromBindings($where, $values);
126 126
 
127
-        return "_" . $values;
127
+        return "_".$values;
128 128
     }
129 129
 
130 130
     protected function getValuesFromWhere(array $where) : string
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             $subKey = str_replace($prefix, "", $subKey);
137 137
             $subKey = str_replace($this->getModelSlug(), "", $subKey);
138 138
             $classParts = explode("\\", get_class($this->model));
139
-            $subKey = strtolower(array_pop($classParts)) . $subKey;
139
+            $subKey = strtolower(array_pop($classParts)).$subKey;
140 140
 
141 141
             return $subKey;
142 142
         }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
             $this->currentBinding++;
157 157
 
158 158
             if ($where["type"] === "between") {
159
-                $values .= "_" . $this->query->bindings["where"][$this->currentBinding];
159
+                $values .= "_".$this->query->bindings["where"][$this->currentBinding];
160 160
                 $this->currentBinding++;
161 161
             }
162 162
         }
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 
167 167
     protected function getWhereClauses(array $wheres = []) : string
168 168
     {
169
-        return "" . $this->getWheres($wheres)
170
-            ->reduce(function ($carry, $where) {
169
+        return "".$this->getWheres($wheres)
170
+            ->reduce(function($carry, $where) {
171 171
                 $value = $carry;
172 172
                 $value .= $this->getNestedClauses($where);
173 173
                 $value .= $this->getColumnClauses($where);
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 
182 182
     protected function getNestedClauses(array $where) : string
183 183
     {
184
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
184
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
185 185
             return "";
186 186
         }
187 187
 
188
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
188
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
189 189
     }
190 190
 
191 191
     protected function getColumnClauses(array $where) : string
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     protected function getInClauses(array $where) : string
201 201
     {
202
-        if (! in_array($where["type"], ["In"])) {
202
+        if (!in_array($where["type"], ["In"])) {
203 203
             return "";
204 204
         }
205 205
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
     protected function getInAndNotInClauses(array $where) : string
213 213
     {
214
-        if (! in_array($where["type"], ["In", "NotIn"])) {
214
+        if (!in_array($where["type"], ["In", "NotIn"])) {
215 215
             return "";
216 216
         }
217 217
 
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                 continue;
250 250
             }
251 251
 
252
-            $result .= $glue . $value;
252
+            $result .= $glue.$value;
253 253
         }
254 254
 
255 255
         return $result;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         $clause = "_{$where["boolean"]}";
266 266
 
267 267
         while (count($queryParts) > 1) {
268
-            $clause .= "_" . array_shift($queryParts);
268
+            $clause .= "_".array_shift($queryParts);
269 269
             $clause .= $this->query->bindings["where"][$this->currentBinding];
270 270
             $this->currentBinding++;
271 271
         }
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
         $lastPart = array_shift($queryParts);
274 274
 
275 275
         if ($lastPart) {
276
-            $clause .= "_" . $lastPart;
276
+            $clause .= "_".$lastPart;
277 277
         }
278 278
 
279
-        return "-" . str_replace(" ", "_", $clause);
279
+        return "-".str_replace(" ", "_", $clause);
280 280
     }
281 281
 
282 282
     protected function getOtherClauses(array $where) : string
@@ -310,8 +310,8 @@  discard block
 block discarded – undo
310 310
             return "";
311 311
         }
312 312
 
313
-        return $eagerLoads->keys()->reduce(function ($carry, $related) {
314
-            if (! method_exists($this->model, $related)) {
313
+        return $eagerLoads->keys()->reduce(function($carry, $related) {
314
+            if (!method_exists($this->model, $related)) {
315 315
                 return "{$carry}-{$related}";
316 316
             }
317 317
 
Please login to merge, or discard this patch.