@@ -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 | } |
@@ -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, |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | { |
93 | 93 | if ($item instanceof MetaItemContract) { |
94 | 94 | |
95 | - if (! is_null($this->findItem($item->key, $item->tag))) { |
|
95 | + if (!is_null($this->findItem($item->key, $item->tag))) { |
|
96 | 96 | $tag = $item->tag ?: $this->default_tag; |
97 | 97 | |
98 | 98 | $key = $item->key; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | { |
120 | 120 | $collection = $this->whereKey($key); |
121 | 121 | |
122 | - if (! is_null($tag)) { |
|
122 | + if (!is_null($tag)) { |
|
123 | 123 | $collection = $collection->whereTag($tag); |
124 | 124 | } |
125 | 125 | |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | */ |
150 | 150 | protected function observeDeletion(MetaItemContract $item) |
151 | 151 | { |
152 | - $item::deleted(function ($model) { |
|
152 | + $item::deleted(function($model) { |
|
153 | 153 | $key = $this->findItem($model->key, $model->tag); |
154 | 154 | |
155 | - if (! is_null($key)) { |
|
155 | + if (!is_null($key)) { |
|
156 | 156 | $this->forget($key); |
157 | 157 | } |
158 | 158 | }); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function __isset($name) |
234 | 234 | { |
235 | - return ! is_null($this->findItem($name, $this->default_tag)); |
|
235 | + return !is_null($this->findItem($name, $this->default_tag)); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | $key = $this->findItem($name, $this->default_tag); |
246 | 246 | |
247 | - if (! is_null($key)) { |
|
247 | + if (!is_null($key)) { |
|
248 | 248 | $this->forget($key); |
249 | 249 | } |
250 | 250 | } |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | { |
261 | 261 | $key = $this->findItem($name, $this->default_tag); |
262 | 262 | |
263 | - if (! is_null($key)) { |
|
263 | + if (!is_null($key)) { |
|
264 | 264 | return $this->get($key)->value; |
265 | 265 | } |
266 | 266 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | { |
283 | 283 | $key = $this->findItem($name, $this->default_tag); |
284 | 284 | |
285 | - if (! is_null($key)) { |
|
285 | + if (!is_null($key)) { |
|
286 | 286 | $this->get($key)->value = $value; |
287 | 287 | } |
288 | 288 | else { |
@@ -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 |