Passed
Pull Request — master (#29)
by Iman
05:26 queued 02:54
created
src/Services/TagService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
 
131 131
     private function fireEvent($event, $tag)
132 132
     {
133
-        ! $event && $event = 'tmp_tagged';
133
+        !$event && $event = 'tmp_tagged';
134 134
 
135
-        $event .= ':'.$this->model->getTable().','.$tag->title;
135
+        $event .= ':' . $this->model->getTable() . ',' . $tag->title;
136 136
 
137 137
         event($event, [$this->model, $tag]);
138 138
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
     private function deleteAll($tags)
153 153
     {
154
-        $tags->each(function ($tag) {
154
+        $tags->each(function($tag) {
155 155
             $tag->delete();
156 156
         });
157 157
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
     private function getCacheKey($title)
165 165
     {
166
-        return 'temp_tag:'.$this->model->getTable().$this->model->getKey().','.$title;
166
+        return 'temp_tag:' . $this->model->getTable() . $this->model->getKey() . ',' . $title;
167 167
     }
168 168
 
169 169
     private function putInCache($expDate, $tagObj)
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     public static function registerRelationship($q)
200 200
     {
201 201
         $table = $q->getModel()->getTable();
202
-        if (! in_array($table, TagService::$registeredRelation)) {
202
+        if (!in_array($table, TagService::$registeredRelation)) {
203 203
             Relation::morphMap([$table => get_class($q->getModel())]);
204 204
             TagService::$registeredRelation[] = $table;
205 205
         }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
     public static function whereHasClosure($relation, $method)
209 209
     {
210
-        return function ($title, $payload = []) use ($relation, $method) {
210
+        return function($title, $payload = []) use ($relation, $method) {
211 211
             TagService::registerRelationship($this);
212 212
 
213 213
             return $this->$method($relation, TagService::getClosure($title, $payload));
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
     public static function whereHasUntilClosure($method)
218 218
     {
219
-        return function ($title, $time, $payload = []) use ($method) {
219
+        return function($title, $time, $payload = []) use ($method) {
220 220
             TagService::registerRelationship($this);
221 221
 
222 222
             return $this->$method('tempTags', TagService::getClosure($title, $payload, ['>', $time]));
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
     public static function getClosure($title, $payload, $time = null)
227 227
     {
228
-        return function ($q) use ($title, $payload, $time) {
228
+        return function($q) use ($title, $payload, $time) {
229 229
             if (is_string($title) && Str::contains($title, ['*'])) {
230 230
                 $title = str_replace('*', '%', $title);
231 231
                 $q->where('title', 'like', $title);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
             }
235 235
 
236 236
             foreach ($payload as $key => $value) {
237
-                $q->where('payload->'.$key, $value);
237
+                $q->where('payload->' . $key, $value);
238 238
             }
239 239
 
240 240
             $time && $q->where('expired_at', $time[0], $time[1]);
Please login to merge, or discard this patch.