@@ -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 | |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | foreach ($rules as $key => $rule) { |
| 26 | - $translationrules['trans.' . $locale . '.'.$key] = $rule; |
|
| 26 | + $translationrules['trans.'.$locale.'.'.$key] = $rule; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | foreach ($attributes as $key => $attribute) { |
| 30 | - $translationattributes['trans.' . $locale . '.'.$key] = $attribute; |
|
| 30 | + $translationattributes['trans.'.$locale.'.'.$key] = $attribute; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | foreach ($messages as $key => $message) { |
| 34 | - $translationmessages['trans.' . $locale . '.'.$key] = $message; |
|
| 34 | + $translationmessages['trans.'.$locale.'.'.$key] = $message; |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | if (PreviewMode::fromRequest()->check()) { |
| 12 | 12 | Session::now('note.default', 'U bekijkt een preview.'); |
| 13 | 13 | return true; |
| 14 | - } else { |
|
| 14 | + }else { |
|
| 15 | 15 | return false; |
| 16 | 16 | } |
| 17 | 17 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public static function reorderAgainstSiblings(array $sequence) |
| 21 | 21 | { |
| 22 | - array_walk($sequence, function ($id, $i) { |
|
| 22 | + array_walk($sequence, function($id, $i) { |
|
| 23 | 23 | self::findOrFail($id)->reorder($i); |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -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\HasPeriod; |
| 6 | 6 | |
@@ -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\Archivable; |
| 6 | 6 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function onlyModules(): Collection |
| 35 | 35 | { |
| 36 | - return $this->collection()->reject(function ($item) { |
|
| 36 | + return $this->collection()->reject(function($item) { |
|
| 37 | 37 | if ($item instanceof Page || $item instanceof StoredSetReference) { |
| 38 | 38 | return true; |
| 39 | 39 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public function onlyPages(): Collection |
| 44 | 44 | { |
| 45 | - return $this->collection()->filter(function ($item) { |
|
| 45 | + return $this->collection()->filter(function($item) { |
|
| 46 | 46 | if ($item instanceof Page) { |
| 47 | 47 | return true; |
| 48 | 48 | } |
@@ -72,12 +72,12 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | // Merging the results of all the pages and all the modules, then filter by the config |
| 74 | 74 | // This prevents us from having duplicates and also reduces the query load. |
| 75 | - $collection = $collection->filter(function ($page) use ($available_children_types) { |
|
| 75 | + $collection = $collection->filter(function($page) use ($available_children_types) { |
|
| 76 | 76 | return in_array(get_class($page), $available_children_types); |
| 77 | 77 | }); |
| 78 | 78 | |
| 79 | 79 | // Filter out our already loaded pages and modules |
| 80 | - $remaining_children_types = collect($available_children_types)->reject(function ($type) { |
|
| 80 | + $remaining_children_types = collect($available_children_types)->reject(function($type) { |
|
| 81 | 81 | return (new $type() instanceof Page || new $type() instanceof Module); |
| 82 | 82 | }); |
| 83 | 83 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $collection = collect(array_merge($collection->all(), (new $type())->all()->all())); |
| 89 | 89 | } |
| 90 | 90 | // Filter out our parent |
| 91 | - return $this->collection = $collection->reject(function ($item) { |
|
| 91 | + return $this->collection = $collection->reject(function($item) { |
|
| 92 | 92 | if ($item instanceof $this->parent) { |
| 93 | 93 | return $item->id == $this->parent->id; |
| 94 | 94 | } |