@@ -25,9 +25,7 @@ |
||
| 25 | 25 | $this->registerClass(get_class($mixed), $mixed); |
| 26 | 26 | |
| 27 | 27 | return true; |
| 28 | - } |
|
| 29 | - |
|
| 30 | - elseif (is_array($mixed)) { |
|
| 28 | + } elseif (is_array($mixed)) { |
|
| 31 | 29 | foreach ($mixed as $type) { |
| 32 | 30 | $this->register($type); |
| 33 | 31 | } |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | if ($item instanceof ItemContract) { |
| 93 | 93 | |
| 94 | - if (! is_null($this->find($item->key, $item->tag))) { |
|
| 94 | + if (!is_null($this->find($item->key, $item->tag))) { |
|
| 95 | 95 | $tag = $item->tag ?: $this->default_tag; |
| 96 | 96 | |
| 97 | 97 | $key = $item->key; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | { |
| 119 | 119 | $collection = $this->whereKey($key); |
| 120 | 120 | |
| 121 | - if (! is_null($tag)) { |
|
| 121 | + if (!is_null($tag)) { |
|
| 122 | 122 | $collection = $collection->whereTag($tag); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | protected function observeDeletion(ItemContract $item) |
| 150 | 150 | { |
| 151 | - $item::deleted(function ($model) { |
|
| 151 | + $item::deleted(function($model) { |
|
| 152 | 152 | $key = $this->find($model->key, $model->tag); |
| 153 | 153 | |
| 154 | - if (! is_null($key)) { |
|
| 154 | + if (!is_null($key)) { |
|
| 155 | 155 | $this->forget($key); |
| 156 | 156 | } |
| 157 | 157 | }); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function __isset($name) |
| 233 | 233 | { |
| 234 | - return ! is_null($this->find($name, $this->default_tag)); |
|
| 234 | + return !is_null($this->find($name, $this->default_tag)); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | { |
| 244 | 244 | $key = $this->find($name, $this->default_tag); |
| 245 | 245 | |
| 246 | - if (! is_null($key)) { |
|
| 246 | + if (!is_null($key)) { |
|
| 247 | 247 | $this->forget($key); |
| 248 | 248 | } |
| 249 | 249 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | { |
| 260 | 260 | $key = $this->find($name, $this->default_tag); |
| 261 | 261 | |
| 262 | - if (! is_null($key)) { |
|
| 262 | + if (!is_null($key)) { |
|
| 263 | 263 | return $this->get($key)->value; |
| 264 | 264 | } |
| 265 | 265 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | { |
| 282 | 282 | $key = $this->find($name, $this->default_tag); |
| 283 | 283 | |
| 284 | - if (! is_null($key)) { |
|
| 284 | + if (!is_null($key)) { |
|
| 285 | 285 | $this->get($key)->value = $value; |
| 286 | 286 | } |
| 287 | 287 | else { |
@@ -283,8 +283,7 @@ |
||
| 283 | 283 | |
| 284 | 284 | if (! is_null($key)) { |
| 285 | 285 | $this->get($key)->value = $value; |
| 286 | - } |
|
| 287 | - else { |
|
| 286 | + } else { |
|
| 288 | 287 | $attr = [ |
| 289 | 288 | 'key' => $name, |
| 290 | 289 | 'value' => $value, |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | return [ |
| 57 | 57 | 'path' => $this->getMigrationPath(), |
| 58 | 58 | 'name' => $name, |
| 59 | - 'table_name' => $name ? $name . '_meta' : 'meta', |
|
| 60 | - 'file_name' => $name ? $name . '_meta_migration' : 'meta_migration', |
|
| 59 | + 'table_name' => $name ? $name.'_meta' : 'meta', |
|
| 60 | + 'file_name' => $name ? $name.'_meta_migration' : 'meta_migration', |
|
| 61 | 61 | ]; |
| 62 | 62 | } |
| 63 | 63 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | protected function replacePlaceholders($template, $name, $table_name) |
| 73 | 73 | { |
| 74 | 74 | $replacements = [ |
| 75 | - 'DummyClass' => ucfirst($name) . 'MetaMigration', |
|
| 75 | + 'DummyClass' => ucfirst($name).'MetaMigration', |
|
| 76 | 76 | 'DummyTable' => $table_name, |
| 77 | 77 | ]; |
| 78 | 78 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | protected function getStub() |
| 88 | 88 | { |
| 89 | - return file_get_contents(__DIR__ . DIRECTORY_SEPARATOR); |
|
| 89 | + return file_get_contents(__DIR__.DIRECTORY_SEPARATOR); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -48,9 +48,7 @@ |
||
| 48 | 48 | { |
| 49 | 49 | if (parent::isDirty($attributes)) { |
| 50 | 50 | return true; |
| 51 | - } |
|
| 52 | - |
|
| 53 | - else { |
|
| 51 | + } else { |
|
| 54 | 52 | foreach ($this->meta as $item) { |
| 55 | 53 | if ($item->isDirty($attributes)) { |
| 56 | 54 | return true; |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | */ |
| 92 | 92 | public function setValueAttribute($value, $type = null) |
| 93 | 93 | { |
| 94 | - if (is_null($type) && ! isset($this->attributes['type'])) { |
|
| 94 | + if (is_null($type) && !isset($this->attributes['type'])) { |
|
| 95 | 95 | $registry = $this->getTypeRegistry(); |
| 96 | 96 | $this->attributes['type'] = $registry->findTypeFor($value)->getClass(); |
| 97 | 97 | } |
@@ -94,9 +94,7 @@ |
||
| 94 | 94 | if (is_null($type) && ! isset($this->attributes['type'])) { |
| 95 | 95 | $registry = $this->getTypeRegistry(); |
| 96 | 96 | $this->attributes['type'] = $registry->findTypeFor($value)->getClass(); |
| 97 | - } |
|
| 98 | - |
|
| 99 | - elseif (isset($type)) { |
|
| 97 | + } elseif (isset($type)) { |
|
| 100 | 98 | $this->attributes['type'] = $type; |
| 101 | 99 | } |
| 102 | 100 | |