@@ -145,9 +145,9 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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)); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | public static function whereHasUntilClosure($method) |
| 236 | 236 | { |
| 237 | - return function ($title, $time, $payload = []) use ($method) { |
|
| 237 | + return function($title, $time, $payload = []) use ($method) { |
|
| 238 | 238 | TagService::registerRelationship($this); |
| 239 | 239 | |
| 240 | 240 | return $this->$method('tempTags', TagService::getClosure($title, $payload, ['>', $time])); |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | public static function getClosure($tagTitle, $payload, $time = null) |
| 245 | 245 | { |
| 246 | - return function ($q) use ($tagTitle, $payload, $time) { |
|
| 246 | + return function($q) use ($tagTitle, $payload, $time) { |
|
| 247 | 247 | self::queryForTitle($tagTitle, $q); |
| 248 | 248 | |
| 249 | 249 | foreach ($payload as $key => $value) { |
| 250 | - $q->where('payload->'.$key, $value); |
|
| 250 | + $q->where('payload->' . $key, $value); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $time && $q->where('expired_at', $time[0], $time[1]); |