Passed
Push — master ( 307822...460179 )
by Iman
03:25
created
src/Services/TagService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
 
146 146
     private function fireEvent($event, $tag)
147 147
     {
148
-        ! $event && $event = 'tmp_tagged';
148
+        !$event && $event = 'tmp_tagged';
149 149
 
150
-        $event .= ':'.$this->model->getTable().','.$tag->title;
150
+        $event .= ':' . $this->model->getTable() . ',' . $tag->title;
151 151
 
152 152
         event($event, [$this->model, $tag]);
153 153
     }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
     private function deleteAll($tags)
168 168
     {
169
-        $tags->each(function ($tag) {
169
+        $tags->each(function($tag) {
170 170
             $tag->delete();
171 171
         });
172 172
     }
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
     private function getCacheKey($title)
183 183
     {
184
-        return 'temp_tag:'.$this->model->getTable().$this->model->getKey().','.$title;
184
+        return 'temp_tag:' . $this->model->getTable() . $this->model->getKey() . ',' . $title;
185 185
     }
186 186
 
187 187
     private function putInCache($expDate, $tagObj)
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     public static function registerRelationship($q)
218 218
     {
219 219
         $table = $q->getModel()->getTable();
220
-        if (! in_array($table, TagService::$registeredRelation)) {
220
+        if (!in_array($table, TagService::$registeredRelation)) {
221 221
             Relation::morphMap([$table => get_class($q->getModel())]);
222 222
             TagService::$registeredRelation[] = $table;
223 223
         }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
     public static function whereHasClosure($relation, $method)
227 227
     {
228
-        return function ($title, $payload = []) use ($relation, $method) {
228
+        return function($title, $payload = []) use ($relation, $method) {
229 229
             TagService::registerRelationship($this);
230 230
 
231 231
             return $this->$method($relation, TagService::getClosure($title, $payload));
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     }
234 234
 
235 235
     public static function whereHasUntilClosure($method) {
236
-        return function ($title, $time, $payload = []) use ($method) {
236
+        return function($title, $time, $payload = []) use ($method) {
237 237
             TagService::registerRelationship($this);
238 238
 
239 239
             return $this->$method('tempTags', TagService::getClosure($title, $payload, ['>', $time]));
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
 
243 243
     public static function getClosure($tagTitle, $payload, $time = null)
244 244
     {
245
-        return function ($q) use ($tagTitle, $payload, $time) {
245
+        return function($q) use ($tagTitle, $payload, $time) {
246 246
             self::queryForTitle($tagTitle, $q);
247 247
 
248 248
             foreach ($payload as $key => $value) {
249
-                $q->where('payload->'.$key, $value);
249
+                $q->where('payload->' . $key, $value);
250 250
             }
251 251
 
252 252
             $time && $q->where('expired_at', $time[0], $time[1]);
Please login to merge, or discard this patch.