Completed
Push — master ( 4ac870...0bb9dd )
by Mike
10s
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"][$this->currentBinding] ?? false)) {
132
+        if (!$values && ($this->query->bindings["where"][$this->currentBinding] ?? 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,11 +160,11 @@  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
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
167
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
168 168
     }
169 169
 
170 170
     protected function getColumnClauses(array $where) : string
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     protected function getInClauses(array $where) : string
182 182
     {
183
-        if (! in_array($where["type"], ["In"])) {
183
+        if (!in_array($where["type"], ["In"])) {
184 184
             return "";
185 185
         }
186 186
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
     protected function getNotInClauses(array $where) : string
194 194
     {
195
-        if (! in_array($where["type"], ["NotIn"])) {
195
+        if (!in_array($where["type"], ["NotIn"])) {
196 196
             return "";
197 197
         }
198 198
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 continue;
214 214
             }
215 215
 
216
-            $result .= $glue . $value;
216
+            $result .= $glue.$value;
217 217
         }
218 218
 
219 219
         return $result;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         $clause = "_{$where["boolean"]}";
230 230
 
231 231
         while (count($queryParts) > 1) {
232
-            $clause .= "_" . array_shift($queryParts);
232
+            $clause .= "_".array_shift($queryParts);
233 233
             $clause .= $this->query->bindings["where"][$this->currentBinding];
234 234
             $this->currentBinding++;
235 235
         }
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
         $lastPart = array_shift($queryParts);
238 238
 
239 239
         if ($lastPart) {
240
-            $clause .= "_" . $lastPart;
240
+            $clause .= "_".$lastPart;
241 241
         }
242 242
 
243
-        return "-" . str_replace(" ", "_", $clause);
243
+        return "-".str_replace(" ", "_", $clause);
244 244
     }
245 245
 
246 246
     protected function getOtherClauses(array $where) : string
@@ -274,6 +274,6 @@  discard block
 block discarded – undo
274 274
             return "";
275 275
         }
276 276
 
277
-        return "-" . implode("-", $eagerLoads->keys()->toArray());
277
+        return "-".implode("-", $eagerLoads->keys()->toArray());
278 278
     }
279 279
 }
Please login to merge, or discard this patch.