Passed
Push — master ( 9b8fdb...e88b61 )
by Mike
02:53
created
src/CacheKey.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     protected function getLimitClause() : string
51 51
     {
52
-        if (! $this->query->limit) {
52
+        if (!$this->query->limit) {
53 53
             return "";
54 54
         }
55 55
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
     protected function getOffsetClause() : string
65 65
     {
66
-        if (! $this->query->offset) {
66
+        if (!$this->query->offset) {
67 67
             return "";
68 68
         }
69 69
 
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
         $orders = collect($this->query->orders);
76 76
 
77 77
         return $orders
78
-            ->reduce(function ($carry, $order) {
78
+            ->reduce(function($carry, $order) {
79 79
                 if (($order["type"] ?? "") === "Raw") {
80
-                    return $carry . "_orderByRaw_" . str_slug($order["sql"]);
80
+                    return $carry."_orderByRaw_".str_slug($order["sql"]);
81 81
                 }
82 82
 
83
-                return $carry . "_orderBy_" . $order["column"] . "_" . $order["direction"];
83
+                return $carry."_orderBy_".$order["column"]."_".$order["direction"];
84 84
             })
85 85
             ?: "";
86 86
     }
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
             return "";
92 92
         }
93 93
 
94
-        return "_" . implode("_", $columns);
94
+        return "_".implode("_", $columns);
95 95
     }
96 96
 
97 97
     protected function getTypeClause($where) : string
98 98
     {
99
-        $type =in_array($where["type"], ["In", "NotIn", "Null", "NotNull", "between"])
99
+        $type = in_array($where["type"], ["In", "NotIn", "Null", "NotNull", "between"])
100 100
             ? strtolower($where["type"])
101 101
             : strtolower($where["operator"]);
102 102
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $values = $this->getValuesFromWhere($where);
113 113
         $values = $this->getValuesFromBindings($values);
114 114
 
115
-        return "_" . $values;
115
+        return "_".$values;
116 116
     }
117 117
 
118 118
     protected function getValuesFromWhere(array $where) : string
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 
125 125
     protected function getValuesFromBindings(string $values) : string
126 126
     {
127
-        if (! $values && $this->query->bindings["where"] ?? false) {
127
+        if (!$values && $this->query->bindings["where"] ?? false) {
128 128
             $values = implode("_", $this->query->bindings["where"]);
129 129
         }
130 130
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     protected function getWhereClauses(array $wheres = []) : string
135 135
     {
136 136
         return $this->getWheres($wheres)
137
-            ->reduce(function ($carry, $where) {
137
+            ->reduce(function($carry, $where) {
138 138
                 $value = $this->getNestedClauses($where);
139 139
                 $value .= $this->getColumnClauses($where);
140 140
                 $value .= $this->getRawClauses($where);
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
 
148 148
     protected function getNestedClauses(array $where) : string
149 149
     {
150
-        if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
150
+        if (!in_array($where["type"], ["Exists", "Nested", "NotExists"])) {
151 151
             return "";
152 152
         }
153 153
 
154
-        return "_" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres);
154
+        return "_".strtolower($where["type"]).$this->getWhereClauses($where["query"]->wheres);
155 155
     }
156 156
 
157 157
     protected function getColumnClauses(array $where) : string
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             return "";
170 170
         }
171 171
 
172
-        return "_{$where["boolean"]}_" . str_slug($where["sql"]);
172
+        return "_{$where["boolean"]}_".str_slug($where["sql"]);
173 173
     }
174 174
 
175 175
     protected function getOtherClauses(array $where, string $carry = null) : string
@@ -203,6 +203,6 @@  discard block
 block discarded – undo
203 203
             return "";
204 204
         }
205 205
 
206
-        return "-" . implode("-", $eagerLoads->keys()->toArray());
206
+        return "-".implode("-", $eagerLoads->keys()->toArray());
207 207
     }
208 208
 }
Please login to merge, or discard this patch.
src/CacheTags.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $tags = collect($this->eagerLoad)
30 30
             ->keys()
31
-            ->map(function ($relationName) {
31
+            ->map(function($relationName) {
32 32
                 $relation = $this->getRelation($relationName);
33 33
 
34 34
                 return $this->getCachePrefix()
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     protected function getRelation(string $relationName) : Relation
54 54
     {
55 55
         return collect(explode('.', $relationName))
56
-            ->reduce(function ($carry, $name) {
56
+            ->reduce(function($carry, $name) {
57 57
                 $carry = $carry ?: $this->model;
58 58
                 $carry = $this->getRelatedModel($carry);
59 59
 
@@ -63,6 +63,6 @@  discard block
 block discarded – undo
63 63
 
64 64
     protected function getTagName() : string
65 65
     {
66
-        return $this->getCachePrefix() . str_slug(get_class($this->model));
66
+        return $this->getCachePrefix().str_slug(get_class($this->model));
67 67
     }
68 68
 }
Please login to merge, or discard this patch.
src/Traits/CachePrefixing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
     protected function getCachePrefix() : string
6 6
     {
7 7
         return "genealabs:laravel-model-caching:"
8
-            . $this->getDatabaseConnectionName() . ":"
8
+            . $this->getDatabaseConnectionName().":"
9 9
             . (config("laravel-model-caching.cache-prefix")
10
-                ? config("laravel-model-caching.cache-prefix", "") . ":"
10
+                ? config("laravel-model-caching.cache-prefix", "").":"
11 11
                 : "");
12 12
     }
13 13
 
Please login to merge, or discard this patch.