@@ -154,9 +154,9 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | private function fireEvent($event, $tag) |
| 156 | 156 | { |
| 157 | - ! $event && $event = 'tmp_tagged'; |
|
| 157 | + !$event && $event = 'tmp_tagged'; |
|
| 158 | 158 | |
| 159 | - $event .= ':'.$this->model->getTable().','.$tag->title; |
|
| 159 | + $event .= ':' . $this->model->getTable() . ',' . $tag->title; |
|
| 160 | 160 | |
| 161 | 161 | event($event, [$this->model, $tag]); |
| 162 | 162 | } |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | private function deleteAll($tags) |
| 177 | 177 | { |
| 178 | - $tags->each(function ($tag) { |
|
| 178 | + $tags->each(function($tag) { |
|
| 179 | 179 | $tag->delete(); |
| 180 | 180 | }); |
| 181 | 181 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | private function getCacheKey($title) |
| 192 | 192 | { |
| 193 | - return 'temp_tag:'.$this->model->getTable().$this->model->getKey().','.$title; |
|
| 193 | + return 'temp_tag:' . $this->model->getTable() . $this->model->getKey() . ',' . $title; |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | private function putInCache($expDate, $tagObj) |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | { |
| 226 | 226 | $table = $q->getModel()->getTable(); |
| 227 | 227 | $relations = Relation::morphMap(); |
| 228 | - if (! isset($relations[$table]) && ! in_array($table, TagService::$registeredRelation)) { |
|
| 228 | + if (!isset($relations[$table]) && !in_array($table, TagService::$registeredRelation)) { |
|
| 229 | 229 | Relation::morphMap([$table => get_class($q->getModel())]); |
| 230 | 230 | TagService::$registeredRelation[$table] = $table; |
| 231 | 231 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | public static function whereHasClosure($relation, $method) |
| 244 | 244 | { |
| 245 | - return function ($title, $payload = []) use ($relation, $method) { |
|
| 245 | + return function($title, $payload = []) use ($relation, $method) { |
|
| 246 | 246 | TagService::registerRelationship($this); |
| 247 | 247 | |
| 248 | 248 | $query = $this->$method($relation, TagService::getClosure($title, $payload)); |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | public static function whereHasUntilClosure($method) |
| 256 | 256 | { |
| 257 | - return function ($title, $time, $payload = []) use ($method) { |
|
| 257 | + return function($title, $time, $payload = []) use ($method) { |
|
| 258 | 258 | TagService::registerRelationship($this); |
| 259 | 259 | |
| 260 | 260 | $query = $this->$method('tempTags', TagService::getClosure($title, $payload, ['>', $time])); |
@@ -266,11 +266,11 @@ discard block |
||
| 266 | 266 | |
| 267 | 267 | public static function getClosure($tagTitle, $payload, $time = null) |
| 268 | 268 | { |
| 269 | - return function ($q) use ($tagTitle, $payload, $time) { |
|
| 269 | + return function($q) use ($tagTitle, $payload, $time) { |
|
| 270 | 270 | self::queryForTitle($tagTitle, $q); |
| 271 | 271 | |
| 272 | 272 | foreach ($payload as $key => $value) { |
| 273 | - $q->where('payload->'.$key, $value); |
|
| 273 | + $q->where('payload->' . $key, $value); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | $time && $q->where('expired_at', $time[0], $time[1]); |