Passed
Push — master ( f90b69...128f25 )
by Mike
02:36
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,12 +92,12 @@  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
99 99
     {
100
-        $type =in_array($where["type"], ["In", "NotIn", "Null", "NotNull", "between"])
100
+        $type = in_array($where["type"], ["In", "NotIn", "Null", "NotNull", "between"])
101 101
             ? strtolower($where["type"])
102 102
             : strtolower($where["operator"]);
103 103
 
@@ -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
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 
130 130
     protected function getValuesFromBindings(array $where, string $values) : string
131 131
     {
132
-        if (! $values && ($this->query->bindings["where"] ?? false)) {
132
+        if (!$values && ($this->query->bindings["where"] ?? false)) {
133 133
             $values = $this->query->bindings["where"][$this->currentBinding];
134 134
             $this->currentBinding++;
135 135
 
136 136
             if ($where["type"] === "between") {
137
-                $values .= "_" . $this->query->bindings["where"][$this->currentBinding];
137
+                $values .= "_".$this->query->bindings["where"][$this->currentBinding];
138 138
                 $this->currentBinding++;
139 139
             }
140 140
         }
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
 
145 145
     protected function getWhereClauses(array $wheres = []) : string
146 146
     {
147
-        return "" . $this->getWheres($wheres)
148
-            ->reduce(function ($carry, $where) {
147
+        return "".$this->getWheres($wheres)
148
+            ->reduce(function($carry, $where) {
149 149
                 $value = $carry;
150 150
                 $value .= $this->getNestedClauses($where);
151 151
                 $value .= $this->getColumnClauses($where);
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
 
161 161
     protected function getNestedClauses(array $where) : string
162 162
     {
163
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
163
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
164 164
             return "";
165 165
         }
166 166
 
167 167
         $this->currentBinding++;
168 168
 
169
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
169
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
170 170
     }
171 171
 
172 172
     protected function getColumnClauses(array $where) : string
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
     protected function getInClauses(array $where) : string
184 184
     {
185
-        if (! in_array($where["type"], ["In"])) {
185
+        if (!in_array($where["type"], ["In"])) {
186 186
             return "";
187 187
         }
188 188
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 
195 195
     protected function getNotInClauses(array $where) : string
196 196
     {
197
-        if (! in_array($where["type"], ["NotIn"])) {
197
+        if (!in_array($where["type"], ["NotIn"])) {
198 198
             return "";
199 199
         }
200 200
 
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                 continue;
216 216
             }
217 217
 
218
-            $result .= $glue . $value;
218
+            $result .= $glue.$value;
219 219
         }
220 220
 
221 221
         return $result;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         $clause = "_{$where["boolean"]}";
232 232
 
233 233
         while (count($queryParts) > 1) {
234
-            $clause .= "_" . array_shift($queryParts);
234
+            $clause .= "_".array_shift($queryParts);
235 235
             $clause .= $this->query->bindings["where"][$this->currentBinding];
236 236
             $this->currentBinding++;
237 237
         }
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
         $lastPart = array_shift($queryParts);
240 240
 
241 241
         if ($lastPart) {
242
-            $clause .= "_" . $lastPart;
242
+            $clause .= "_".$lastPart;
243 243
         }
244 244
 
245
-        return "-" . str_replace(" ", "_", $clause);
245
+        return "-".str_replace(" ", "_", $clause);
246 246
     }
247 247
 
248 248
     protected function getOtherClauses(array $where) : string
@@ -276,6 +276,6 @@  discard block
 block discarded – undo
276 276
             return "";
277 277
         }
278 278
 
279
-        return "-" . implode("-", $eagerLoads->keys()->toArray());
279
+        return "-".implode("-", $eagerLoads->keys()->toArray());
280 280
     }
281 281
 }
Please login to merge, or discard this patch.