@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | // Push update to homepage setting value |
| 71 | 71 | // TODO: we should just fetch the homepages and push that instead... |
| 72 | - UrlRecord::getByModel($this->manager->existingModel())->reject(function ($record) { |
|
| 72 | + UrlRecord::getByModel($this->manager->existingModel())->reject(function($record) { |
|
| 73 | 73 | return ($record->isRedirect() || !$record->isHomepage()); |
| 74 | - })->each(function ($record) { |
|
| 74 | + })->each(function($record) { |
|
| 75 | 75 | app(ChangeHomepage::class)->onUrlChanged($record); |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | private function validateModel() |
| 85 | 85 | { |
| 86 | 86 | if (!$this->manager->existingModel() instanceof ProvidesUrl) { |
| 87 | - throw new \Exception('UrlAssistant requires the model interfaced by ' . ProvidesUrl::class . '.'); |
|
| 87 | + throw new \Exception('UrlAssistant requires the model interfaced by '.ProvidesUrl::class.'.'); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -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 | }); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | return $this->indexPagination($builder); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - return $builder->get()->map(function ($model) { |
|
| 94 | + return $builder->get()->map(function($model) { |
|
| 95 | 95 | return (new static($this->registration))->manage($model); |
| 96 | 96 | }); |
| 97 | 97 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | { |
| 120 | 120 | $paginator = $builder->paginate($this->pageCount); |
| 121 | 121 | |
| 122 | - $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function ($model) { |
|
| 122 | + $modifiedCollection = $builder->paginate($this->pageCount)->getCollection()->transform(function($model) { |
|
| 123 | 123 | return (new static($this->registration))->manage($model); |
| 124 | 124 | }); |
| 125 | 125 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | public function editFields(): Fields |
| 237 | 237 | { |
| 238 | - return $this->fieldsWithAssistantFields()->map(function (Field $field) { |
|
| 238 | + return $this->fieldsWithAssistantFields()->map(function(Field $field) { |
|
| 239 | 239 | return $field->model($this->model); |
| 240 | 240 | }); |
| 241 | 241 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | static::$bootedTraitMethods[$baseMethod] = []; |
| 329 | 329 | |
| 330 | 330 | foreach (class_uses_recursive($class) as $trait) { |
| 331 | - $method = class_basename($trait) . ucfirst($baseMethod); |
|
| 331 | + $method = class_basename($trait).ucfirst($baseMethod); |
|
| 332 | 332 | |
| 333 | 333 | if (method_exists($class, $method) && !in_array($method, static::$bootedTraitMethods[$baseMethod])) { |
| 334 | 334 | static::$bootedTraitMethods[$baseMethod][] = lcfirst($method); |
@@ -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,30 +91,30 @@ 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 | - return new static(array_filter($this->fields, function (Field $field) use ($keys) { |
|
| 103 | + return new static(array_filter($this->fields, function(Field $field) use ($keys) { |
|
| 104 | 104 | return in_array($field->getKey(), $keys); |
| 105 | 105 | })); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | public function tagged($tag): Fields |
| 109 | 109 | { |
| 110 | - return new static(array_filter($this->fields, function (Field $field) use ($tag) { |
|
| 110 | + return new static(array_filter($this->fields, function(Field $field) use ($tag) { |
|
| 111 | 111 | return $field->tagged($tag); |
| 112 | 112 | })); |
| 113 | 113 | } |
| 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 | |
@@ -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 |