@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | public function route($verb): ?string |
| 36 | 36 | { |
| 37 | - if($this->manager->hasExistingModel()) { |
|
| 37 | + if ($this->manager->hasExistingModel()) { |
|
| 38 | 38 | $routes = [ |
| 39 | 39 | 'check' => route('chief.back.assistants.url.check', [ |
| 40 | 40 | $this->manager->details()->key, |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | // Push update to homepage setting value |
| 80 | 80 | // TODO: we should just fetch the homepages and push that instead... |
| 81 | - UrlRecord::getByModel($this->manager->existingModel())->reject(function ($record) { |
|
| 81 | + UrlRecord::getByModel($this->manager->existingModel())->reject(function($record) { |
|
| 82 | 82 | return ($record->isRedirect() || !$record->isHomepage()); |
| 83 | - })->each(function ($record) { |
|
| 83 | + })->each(function($record) { |
|
| 84 | 84 | app(ChangeHomepage::class)->onUrlChanged($record); |
| 85 | 85 | }); |
| 86 | 86 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | private function validateModel() |
| 94 | 94 | { |
| 95 | 95 | if (!$this->manager->existingModel() instanceof ProvidesUrl) { |
| 96 | - throw new \Exception('UrlAssistant requires the model interfaced by ' . ProvidesUrl::class . '.'); |
|
| 96 | + throw new \Exception('UrlAssistant requires the model interfaced by '.ProvidesUrl::class.'.'); |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return $this->indexPagination($builder); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return $builder->get()->map(function ($model) { |
|
| 91 | + return $builder->get()->map(function($model) { |
|
| 92 | 92 | return (new static($this->registration))->manage($model); |
| 93 | 93 | }); |
| 94 | 94 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | { |
| 117 | 117 | $paginator = $builder->paginate($this->pageCount); |
| 118 | 118 | |
| 119 | - $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function ($model) { |
|
| 119 | + $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function($model) { |
|
| 120 | 120 | return (new static($this->registration))->manage($model); |
| 121 | 121 | }); |
| 122 | 122 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | |
| 233 | 233 | public function editFields(): Fields |
| 234 | 234 | { |
| 235 | - return $this->fieldsWithAssistantFields()->map(function(Field $field){ |
|
| 235 | + return $this->fieldsWithAssistantFields()->map(function(Field $field) { |
|
| 236 | 236 | return $field->model($this->model); |
| 237 | 237 | }); |
| 238 | 238 | } |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | static::$bootedTraitMethods[$baseMethod] = []; |
| 326 | 326 | |
| 327 | 327 | foreach (class_uses_recursive($class) as $trait) { |
| 328 | - $method = class_basename($trait) . ucfirst($baseMethod); |
|
| 328 | + $method = class_basename($trait).ucfirst($baseMethod); |
|
| 329 | 329 | |
| 330 | 330 | if (method_exists($class, $method) && !in_array($method, static::$bootedTraitMethods[$baseMethod])) { |
| 331 | 331 | static::$bootedTraitMethods[$baseMethod][] = lcfirst($method); |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | |
| 52 | 52 | public function editFields(): Fields |
| 53 | 53 | { |
| 54 | - return $this->fields()->map(function(Field $field){ |
|
| 55 | - return $field->valueResolver(function($model = null, $locale = null, $field){ |
|
| 54 | + return $this->fields()->map(function(Field $field) { |
|
| 55 | + return $field->valueResolver(function($model = null, $locale = null, $field) { |
|
| 56 | 56 | return $this->settings->get($field->getKey(), $locale); |
| 57 | 57 | }); |
| 58 | 58 | }); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | */ |
| 238 | 238 | private function defaultEloquentValueResolver(): \Closure |
| 239 | 239 | { |
| 240 | - return function (Model $model = null, $locale = null) { |
|
| 240 | + return function(Model $model = null, $locale = null) { |
|
| 241 | 241 | if (!$model) { |
| 242 | 242 | return $this->value; |
| 243 | 243 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | return $this->isLocalized() |
| 392 | 392 | ? 'chief::back._formgroups.fieldgroup_translatable' |
| 393 | - : 'chief::back._fields.' . $this->type->get(); |
|
| 393 | + : 'chief::back._fields.'.$this->type->get(); |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | public function viewData(array $viewData = []): Field |
@@ -406,6 +406,6 @@ discard block |
||
| 406 | 406 | 'model' => $this->getModel(), |
| 407 | 407 | 'field' => $this, |
| 408 | 408 | 'key' => $this->getKey(), |
| 409 | - ],$this->viewData); |
|
| 409 | + ], $this->viewData); |
|
| 410 | 410 | } |
| 411 | 411 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | public function tagged($tag): bool |
| 10 | 10 | { |
| 11 | - $tags = (array) $tag; |
|
| 11 | + $tags = (array)$tag; |
|
| 12 | 12 | |
| 13 | 13 | return count(array_intersect($this->tags, $tags)) > 0; |
| 14 | 14 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | continue; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - $method = 'get' . ucfirst($key); |
|
| 78 | + $method = 'get'.ucfirst($key); |
|
| 79 | 79 | |
| 80 | 80 | // Reject from list if value does not match expected one |
| 81 | 81 | if ($value && $value == $field->$method()) { |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function render(): string |
| 93 | 93 | { |
| 94 | - return array_reduce($this->fields, function(string $carry, Field $field){ |
|
| 95 | - return $carry . $field->render(); |
|
| 94 | + return array_reduce($this->fields, function(string $carry, Field $field) { |
|
| 95 | + return $carry.$field->render(); |
|
| 96 | 96 | }, ''); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function keyed($key): Fields |
| 100 | 100 | { |
| 101 | - $keys = (array) $key; |
|
| 101 | + $keys = (array)$key; |
|
| 102 | 102 | |
| 103 | 103 | return new static(array_filter($this->fields, function(Field $field) use($keys){ |
| 104 | 104 | return in_array($field->getKey(), $keys); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | public function untagged(): Fields |
| 116 | 116 | { |
| 117 | - return new static(array_filter($this->fields, function(Field $field){ |
|
| 117 | + return new static(array_filter($this->fields, function(Field $field) { |
|
| 118 | 118 | return $field->untagged(); |
| 119 | 119 | })); |
| 120 | 120 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | public function offsetSet($offset, $value) |
| 164 | 164 | { |
| 165 | 165 | if (!$value instanceof Field) { |
| 166 | - throw new \InvalidArgumentException('Passed value must be of type ' . Field::class); |
|
| 166 | + throw new \InvalidArgumentException('Passed value must be of type '.Field::class); |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | $this->fields[$offset] = $value; |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | private function validateFields(array $fields) |
| 195 | 195 | { |
| 196 | - array_map(function (Field $field) { |
|
| 196 | + array_map(function(Field $field) { |
|
| 197 | 197 | }, $fields); |
| 198 | 198 | } |
| 199 | 199 | |
@@ -84,9 +84,9 @@ discard block |
||
| 84 | 84 | $this->pageBuilderField(), |
| 85 | 85 | InputField::make('title')->translatable($this->model->availableLocales()) |
| 86 | 86 | ->validation('required-fallback-locale|max:200', [], [ |
| 87 | - 'trans.' . config('app.fallback_locale', 'nl') . '.title' => 'title', |
|
| 87 | + 'trans.'.config('app.fallback_locale', 'nl').'.title' => 'title', |
|
| 88 | 88 | ]) |
| 89 | - ->label('De titel van je ' . $this->model->labelSingular ?? 'pagina') |
|
| 89 | + ->label('De titel van je '.$this->model->labelSingular ?? 'pagina') |
|
| 90 | 90 | ->description('Dit is de titel die zal worden getoond in de overzichten en modules.') |
| 91 | 91 | ->tag('general'), |
| 92 | 92 | InputField::make('seo_title') |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | if (is_array_empty($translation)) { |
| 207 | 207 | |
| 208 | 208 | // Nullify all values |
| 209 | - $trans[$locale] = array_map(function ($value) { |
|
| 209 | + $trans[$locale] = array_map(function($value) { |
|
| 210 | 210 | return null; |
| 211 | 211 | }, $translation); |
| 212 | 212 | continue; |