@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\Fields\Types; |
6 | 6 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $value = parent::__get($key); |
51 | 51 | |
52 | 52 | // Default empty array for these following values |
53 | - if (!$value && in_array($key, ['sections','availableModules','availablePages', 'availableSets'])) { |
|
53 | + if (!$value && in_array($key, ['sections', 'availableModules', 'availablePages', 'availableSets'])) { |
|
54 | 54 | return []; |
55 | 55 | } |
56 | 56 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Thinktomorrow\Chief\Fields\Types; |
4 | 4 | |
5 | 5 | class HtmlField extends Field |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | namespace Thinktomorrow\Chief\Fields\Types; |
4 | 4 | |
5 | 5 | class DateField extends Field |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | private function validateTabs(array $tabs) |
49 | 49 | { |
50 | - array_map(function (FieldsTab $tab) { |
|
50 | + array_map(function(FieldsTab $tab) { |
|
51 | 51 | }, $tabs); |
52 | 52 | } |
53 | 53 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\Concerns\Morphable; |
6 | 6 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | } |
17 | 17 | |
18 | 18 | if (!class_exists($class)) { |
19 | - throw new NotFoundMorphKey('No class found by morphkey [' . $class . ']. Make sure that the morphkey is a valid class reference.'); |
|
19 | + throw new NotFoundMorphKey('No class found by morphkey ['.$class.']. Make sure that the morphkey is a valid class reference.'); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | return new $class($attributes); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public function scopeMorphable($query, string $morphkey = null) |
33 | 33 | { |
34 | 34 | return $query->withoutGlobalScope(static::globalMorphableScope()) |
35 | - ->where('morph_key', '=', $morphkey); |
|
35 | + ->where('morph_key', '=', $morphkey); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | private function convertToMorphInstance(Model $model, string $morphKey): Model |
46 | 46 | { |
47 | 47 | // Here we load up the proper collection model instead of the generic base class. |
48 | - return tap(Morphables::instance($morphKey, $model->attributes), function ($instance) use ($model) { |
|
48 | + return tap(Morphables::instance($morphKey, $model->attributes), function($instance) use ($model) { |
|
49 | 49 | $instance->setRawAttributes($model->attributes); |
50 | 50 | $instance->setRelations($model->relations); |
51 | 51 | $instance->exists = $model->exists; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | if ($this->requiresCustomTranslation($instance)) { |
67 | 67 | if (!is_array($instance->with) || !in_array('translations', $instance->with)) { |
68 | 68 | $instance->unsetRelation('translations'); |
69 | - } else { |
|
69 | + }else { |
|
70 | 70 | // TODO: this is a heavy queryload since it loads new translations for each model... |
71 | 71 | // Removing this could reduce load by approx. 50%. |
72 | 72 | // $instance->load('translations'); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $available_locales = static::availableLocales(); |
147 | 147 | $current_locales = $this->translations->pluck('locale')->toArray(); |
148 | 148 | |
149 | - return array_filter($available_locales, function ($v) use ($current_locales, $available) { |
|
149 | + return array_filter($available_locales, function($v) use ($current_locales, $available) { |
|
150 | 150 | return $available ? in_array($v, $current_locales) : !in_array($v, $current_locales); |
151 | 151 | }, ARRAY_FILTER_USE_BOTH); |
152 | 152 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | private function validateLocale($locale) |
160 | 160 | { |
161 | 161 | if (!in_array($locale, static::availableLocales())) { |
162 | - throw new InvalidArgumentException('Locale [' . $locale . '] is not available'); |
|
162 | + throw new InvalidArgumentException('Locale ['.$locale.'] is not available'); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 |