Passed
Push — master ( 0bb9dd...95a5ef )
by Mike
04:52
created
src/CacheKey.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     protected function getLimitClause() : string
52 52
     {
53
-        if (! $this->query->limit) {
53
+        if (!$this->query->limit) {
54 54
             return "";
55 55
         }
56 56
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     protected function getOffsetClause() : string
66 66
     {
67
-        if (! $this->query->offset) {
67
+        if (!$this->query->offset) {
68 68
             return "";
69 69
         }
70 70
 
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
         $orders = collect($this->query->orders);
77 77
 
78 78
         return $orders
79
-            ->reduce(function ($carry, $order) {
79
+            ->reduce(function($carry, $order) {
80 80
                 if (($order["type"] ?? "") === "Raw") {
81
-                    return $carry . "_orderByRaw_" . str_slug($order["sql"]);
81
+                    return $carry."_orderByRaw_".str_slug($order["sql"]);
82 82
                 }
83 83
 
84
-                return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"];
84
+                return $carry."_orderBy_".$order["column"]."_".$order["direction"];
85 85
             })
86 86
             ?: "";
87 87
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             return "";
93 93
         }
94 94
 
95
-        return "_" . implode("_", $columns);
95
+        return "_".implode("_", $columns);
96 96
     }
97 97
 
98 98
     protected function getTypeClause($where) : string
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 
117 117
 
118
-        return "_" . $values;
118
+        return "_".$values;
119 119
     }
120 120
 
121 121
     protected function getValuesFromWhere(array $where) : string
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
             $subKey = str_replace($prefix, "", $subKey);
128 128
             $subKey = str_replace($this->getModelSlug(), "", $subKey);
129 129
             $classParts = explode("\\", get_class($this->model));
130
-            $subKey = strtolower(array_pop($classParts)) . $subKey;
130
+            $subKey = strtolower(array_pop($classParts)).$subKey;
131 131
 
132 132
             return $subKey;
133 133
         }
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
 
142 142
     protected function getValuesFromBindings(array $where, string $values) : string
143 143
     {
144
-        if (! $values && ($this->query->bindings["where"][$this->currentBinding] ?? false)) {
144
+        if (!$values && ($this->query->bindings["where"][$this->currentBinding] ?? false)) {
145 145
             $values = $this->query->bindings["where"][$this->currentBinding];
146 146
             $this->currentBinding++;
147 147
 
148 148
             if ($where["type"] === "between") {
149
-                $values .= "_" . $this->query->bindings["where"][$this->currentBinding];
149
+                $values .= "_".$this->query->bindings["where"][$this->currentBinding];
150 150
                 $this->currentBinding++;
151 151
             }
152 152
         }
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 
157 157
     protected function getWhereClauses(array $wheres = []) : string
158 158
     {
159
-        return "" . $this->getWheres($wheres)
160
-            ->reduce(function ($carry, $where) {
159
+        return "".$this->getWheres($wheres)
160
+            ->reduce(function($carry, $where) {
161 161
                 $value = $carry;
162 162
                 $value .= $this->getNestedClauses($where);
163 163
                 $value .= $this->getColumnClauses($where);
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
 
173 173
     protected function getNestedClauses(array $where) : string
174 174
     {
175
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
175
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
176 176
             return "";
177 177
         }
178 178
 
179
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
179
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
180 180
     }
181 181
 
182 182
     protected function getColumnClauses(array $where) : string
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
     protected function getInClauses(array $where) : string
192 192
     {
193
-        if (! in_array($where["type"], ["In"])) {
193
+        if (!in_array($where["type"], ["In"])) {
194 194
             return "";
195 195
         }
196 196
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
 
203 203
     protected function getNotInClauses(array $where) : string
204 204
     {
205
-        if (! in_array($where["type"], ["NotIn"])) {
205
+        if (!in_array($where["type"], ["NotIn"])) {
206 206
             return "";
207 207
         }
208 208
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                 continue;
224 224
             }
225 225
 
226
-            $result .= $glue . $value;
226
+            $result .= $glue.$value;
227 227
         }
228 228
 
229 229
         return $result;
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
         $clause = "_{$where["boolean"]}";
240 240
 
241 241
         while (count($queryParts) > 1) {
242
-            $clause .= "_" . array_shift($queryParts);
242
+            $clause .= "_".array_shift($queryParts);
243 243
             $clause .= $this->query->bindings["where"][$this->currentBinding];
244 244
             $this->currentBinding++;
245 245
         }
@@ -247,10 +247,10 @@  discard block
 block discarded – undo
247 247
         $lastPart = array_shift($queryParts);
248 248
 
249 249
         if ($lastPart) {
250
-            $clause .= "_" . $lastPart;
250
+            $clause .= "_".$lastPart;
251 251
         }
252 252
 
253
-        return "-" . str_replace(" ", "_", $clause);
253
+        return "-".str_replace(" ", "_", $clause);
254 254
     }
255 255
 
256 256
     protected function getOtherClauses(array $where) : string
@@ -284,6 +284,6 @@  discard block
 block discarded – undo
284 284
             return "";
285 285
         }
286 286
 
287
-        return "-" . implode("-", $eagerLoads->keys()->toArray());
287
+        return "-".implode("-", $eagerLoads->keys()->toArray());
288 288
     }
289 289
 }
Please login to merge, or discard this patch.