Passed
Push — master ( b9494e...ff42fa )
by Mike
02:52
created
src/CacheKey.php 1 patch
Spacing   +19 added lines, -19 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);
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
 
160 160
     protected function getNestedClauses(array $where) : string
161 161
     {
162
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
162
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
163 163
             return "";
164 164
         }
165 165
 
166 166
         $this->currentBinding++;
167 167
 
168
-        return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
168
+        return "-".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
169 169
     }
170 170
 
171 171
     protected function getColumnClauses(array $where) : string
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                 continue;
203 203
             }
204 204
 
205
-            $result .= $glue . $value;
205
+            $result .= $glue.$value;
206 206
         }
207 207
 
208 208
         return $result;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $clause = "_{$where["boolean"]}";
219 219
 
220 220
         while (count($queryParts) > 1) {
221
-            $clause .= "_" . array_shift($queryParts);
221
+            $clause .= "_".array_shift($queryParts);
222 222
             $clause .= $this->query->bindings["where"][$this->currentBinding];
223 223
             $this->currentBinding++;
224 224
         }
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
         $lastPart = array_shift($queryParts);
227 227
 
228 228
         if ($lastPart) {
229
-            $clause .= "_" . $lastPart;
229
+            $clause .= "_".$lastPart;
230 230
         }
231 231
 
232
-        return "-" . str_replace(" ", "_", $clause);
232
+        return "-".str_replace(" ", "_", $clause);
233 233
     }
234 234
 
235 235
     protected function getOtherClauses(array $where) : string
@@ -263,6 +263,6 @@  discard block
 block discarded – undo
263 263
             return "";
264 264
         }
265 265
 
266
-        return "-" . implode("-", $eagerLoads->keys()->toArray());
266
+        return "-".implode("-", $eagerLoads->keys()->toArray());
267 267
     }
268 268
 }
Please login to merge, or discard this patch.