@@ -38,7 +38,7 @@ |
||
38 | 38 | private function addCustomValidationMessage($attribute, $params, $validator): void |
39 | 39 | { |
40 | 40 | $validator->setCustomMessages([ |
41 | - 'filefield_min' => ':attribute is te klein en dient groter te zijn dan ' . implode(',', $params) . 'Kb.', |
|
41 | + 'filefield_min' => ':attribute is te klein en dient groter te zijn dan '.implode(',', $params).'Kb.', |
|
42 | 42 | ]); |
43 | 43 | |
44 | 44 | if (!isset($validator->customAttributes[$attribute])) { |
@@ -76,7 +76,7 @@ |
||
76 | 76 | private function addCustomValidationMessage($attribute, $params, $validator): void |
77 | 77 | { |
78 | 78 | $validator->setCustomMessages([ |
79 | - 'imagefield_dimensions' => ':attribute heeft niet de juiste afmetingen: ' . implode(', ', $this->humanReadableParams($params)), |
|
79 | + 'imagefield_dimensions' => ':attribute heeft niet de juiste afmetingen: '.implode(', ', $this->humanReadableParams($params)), |
|
80 | 80 | ]); |
81 | 81 | |
82 | 82 | if (!isset($validator->customAttributes[$attribute])) { |
@@ -56,7 +56,7 @@ |
||
56 | 56 | protected function validateAssetMimetypes(Asset $asset, $parameters) |
57 | 57 | { |
58 | 58 | return (in_array($asset->getMimeType(), $parameters) || |
59 | - in_array(explode('/', $asset->getMimeType())[0] . '/*', $parameters)); |
|
59 | + in_array(explode('/', $asset->getMimeType())[0].'/*', $parameters)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | protected function validateAssetMax(Asset $asset, $parameters) |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | |
41 | 41 | public function find(string $key): Field |
42 | 42 | { |
43 | - if(!isset($this->fields[$key])) { |
|
44 | - throw new \InvalidArgumentException('No field found by key ' . $key); |
|
43 | + if (!isset($this->fields[$key])) { |
|
44 | + throw new \InvalidArgumentException('No field found by key '.$key); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | return $this->fields[$key]; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | continue; |
102 | 102 | } |
103 | 103 | |
104 | - $method = 'get' . ucfirst($key); |
|
104 | + $method = 'get'.ucfirst($key); |
|
105 | 105 | |
106 | 106 | // Reject from list if value does not match expected one |
107 | 107 | if ($value && $value == $field->$method()) { |
@@ -117,30 +117,30 @@ discard block |
||
117 | 117 | |
118 | 118 | public function render(): string |
119 | 119 | { |
120 | - return array_reduce($this->fields, function (string $carry, Field $field) { |
|
121 | - return $carry . $field->render(); |
|
120 | + return array_reduce($this->fields, function(string $carry, Field $field) { |
|
121 | + return $carry.$field->render(); |
|
122 | 122 | }, ''); |
123 | 123 | } |
124 | 124 | |
125 | 125 | public function keyed($key): Fields |
126 | 126 | { |
127 | - $keys = (array) $key; |
|
127 | + $keys = (array)$key; |
|
128 | 128 | |
129 | - return new static(array_filter($this->fields, function (Field $field) use ($keys) { |
|
129 | + return new static(array_filter($this->fields, function(Field $field) use ($keys) { |
|
130 | 130 | return in_array($field->getKey(), $keys); |
131 | 131 | })); |
132 | 132 | } |
133 | 133 | |
134 | 134 | public function tagged($tag): Fields |
135 | 135 | { |
136 | - return new static(array_filter($this->fields, function (Field $field) use ($tag) { |
|
136 | + return new static(array_filter($this->fields, function(Field $field) use ($tag) { |
|
137 | 137 | return $field->tagged($tag); |
138 | 138 | })); |
139 | 139 | } |
140 | 140 | |
141 | 141 | public function untagged(): Fields |
142 | 142 | { |
143 | - return new static(array_filter($this->fields, function (Field $field) { |
|
143 | + return new static(array_filter($this->fields, function(Field $field) { |
|
144 | 144 | return $field->untagged(); |
145 | 145 | })); |
146 | 146 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function offsetGet($offset) |
183 | 183 | { |
184 | 184 | if (!isset($this->fields[$offset])) { |
185 | - throw new \RuntimeException('No field found by key [' . $offset . ']'); |
|
185 | + throw new \RuntimeException('No field found by key ['.$offset.']'); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | return $this->fields[$offset]; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | public function offsetSet($offset, $value) |
192 | 192 | { |
193 | 193 | if (!$value instanceof Field) { |
194 | - throw new \InvalidArgumentException('Passed value must be of type ' . Field::class); |
|
194 | + throw new \InvalidArgumentException('Passed value must be of type '.Field::class); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | $this->fields[$offset] = $value; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | private function validateFields(array $fields) |
223 | 223 | { |
224 | - array_map(function (Field $field) { |
|
224 | + array_map(function(Field $field) { |
|
225 | 225 | }, $fields); |
226 | 226 | } |
227 | 227 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | if ($reference->hasFragmentKey()) { |
28 | 28 | if (!$field instanceof FragmentField) { |
29 | - throw new \RuntimeException('Field ' . $field->getKey() . ' was expected to be a fragmentfield but its not.'); |
|
29 | + throw new \RuntimeException('Field '.$field->getKey().' was expected to be a fragmentfield but its not.'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | $firstFragment = $field->getFragments()[0]; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $genericModelInstance = $this->modelInstance(); |
17 | 17 | |
18 | 18 | // Generic model details |
19 | - $id = Str::slug($this->registration->key() . ($this->hasExistingModel() ? '-' . $this->existingModel()->id : '')); |
|
19 | + $id = Str::slug($this->registration->key().($this->hasExistingModel() ? '-'.$this->existingModel()->id : '')); |
|
20 | 20 | $key = $this->registration->key(); |
21 | 21 | $labelSingular = property_exists($genericModelInstance, 'labelSingular') ? $genericModelInstance->labelSingular : Str::singular($key); |
22 | 22 | $labelPlural = property_exists($genericModelInstance, 'labelPlural') ? $genericModelInstance->labelPlural : Str::plural($key); |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | return new Details( |
33 | 33 | $id, |
34 | 34 | $key, |
35 | - $labelSingular . '', |
|
36 | - $labelPlural . '', |
|
35 | + $labelSingular.'', |
|
36 | + $labelPlural.'', |
|
37 | 37 | $internal_label, |
38 | - $title . '' |
|
38 | + $title.'' |
|
39 | 39 | ); |
40 | 40 | } |
41 | 41 | } |
@@ -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); |
@@ -40,9 +40,9 @@ |
||
40 | 40 | if ($request->filled('template')) { |
41 | 41 | $this->applyTemplate->handle( |
42 | 42 | ModelReference::fromString($request->input('template'))->className(), |
43 | - (string) ModelReference::fromString($request->input('template'))->id(), |
|
43 | + (string)ModelReference::fromString($request->input('template'))->id(), |
|
44 | 44 | get_class($manager->existingModel()), |
45 | - (string) $manager->existingModel()->id |
|
45 | + (string)$manager->existingModel()->id |
|
46 | 46 | ); |
47 | 47 | } |
48 | 48 |
@@ -75,21 +75,21 @@ |
||
75 | 75 | private function validate($managerClass, $modelClass) |
76 | 76 | { |
77 | 77 | if (!class_exists($managerClass)) { |
78 | - throw new \InvalidArgumentException('Manager class [' . $managerClass . '] is an invalid class reference. Please make sure the class exists.'); |
|
78 | + throw new \InvalidArgumentException('Manager class ['.$managerClass.'] is an invalid class reference. Please make sure the class exists.'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if (!class_exists($modelClass)) { |
82 | - throw new \InvalidArgumentException('Model class [' . $modelClass . '] is an invalid model reference. Please make sure the class exists.'); |
|
82 | + throw new \InvalidArgumentException('Model class ['.$modelClass.'] is an invalid model reference. Please make sure the class exists.'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $manager = new \ReflectionClass($managerClass); |
86 | 86 | if (!$manager->implementsInterface(Manager::class)) { |
87 | - throw new \InvalidArgumentException('Class [' . $managerClass . '] is expected to implement the [' . Manager::class . '] contract.'); |
|
87 | + throw new \InvalidArgumentException('Class ['.$managerClass.'] is expected to implement the ['.Manager::class.'] contract.'); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | $model = new \ReflectionClass($modelClass); |
91 | 91 | if (!$model->implementsInterface(ManagedModel::class)) { |
92 | - throw new \InvalidArgumentException('Class [' . $modelClass . '] is expected to implement the [' . ManagedModel::class . '] contract.'); |
|
92 | + throw new \InvalidArgumentException('Class ['.$modelClass.'] is expected to implement the ['.ManagedModel::class.'] contract.'); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |