@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function viewData(): array |
30 | 30 | { |
31 | - return array_merge( parent::viewData(),[ |
|
31 | + return array_merge(parent::viewData(), [ |
|
32 | 32 | 'options' => $this->options, |
33 | 33 | ]); |
34 | 34 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function viewData(): array |
30 | 30 | { |
31 | - return array_merge( parent::viewData(),[ |
|
31 | + return array_merge(parent::viewData(), [ |
|
32 | 32 | 'options' => $this->options, |
33 | 33 | ]); |
34 | 34 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | protected function viewData(): array |
38 | 38 | { |
39 | - return array_merge( parent::viewData(),[ |
|
39 | + return array_merge(parent::viewData(), [ |
|
40 | 40 | 'options' => $this->options, |
41 | 41 | 'multiple' => $this->multiple, |
42 | 42 | ]); |
@@ -46,7 +46,9 @@ |
||
46 | 46 | |
47 | 47 | public function anyRenderable(): bool |
48 | 48 | { |
49 | - if($this->isEmpty()) return false; |
|
49 | + if($this->isEmpty()) { |
|
50 | + return false; |
|
51 | + } |
|
50 | 52 | |
51 | 53 | // If at least one of the filters has content to be rendered. |
52 | 54 | foreach($this->filters as $filter) { |
@@ -34,8 +34,8 @@ discard block |
||
34 | 34 | |
35 | 35 | public function render(): string |
36 | 36 | { |
37 | - return array_reduce($this->all(), function ($carry, Filter $filter) { |
|
38 | - return $carry . $filter->render(); |
|
37 | + return array_reduce($this->all(), function($carry, Filter $filter) { |
|
38 | + return $carry.$filter->render(); |
|
39 | 39 | }, ''); |
40 | 40 | } |
41 | 41 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | |
47 | 47 | public function anyRenderable(): bool |
48 | 48 | { |
49 | - if($this->isEmpty()) return false; |
|
49 | + if ($this->isEmpty()) return false; |
|
50 | 50 | |
51 | 51 | // If at least one of the filters has content to be rendered. |
52 | - foreach($this->filters as $filter) { |
|
53 | - if($filter->render()) { |
|
52 | + foreach ($this->filters as $filter) { |
|
53 | + if ($filter->render()) { |
|
54 | 54 | return true; |
55 | 55 | } |
56 | 56 | } |
@@ -65,23 +65,23 @@ discard block |
||
65 | 65 | |
66 | 66 | public function keys(): array |
67 | 67 | { |
68 | - return array_map(function (AbstractFilter $filter) { |
|
68 | + return array_map(function(AbstractFilter $filter) { |
|
69 | 69 | return $filter->key(); |
70 | 70 | }, $this->filters); |
71 | 71 | } |
72 | 72 | |
73 | 73 | private function validateFilters(array $filters) |
74 | 74 | { |
75 | - array_map(function (Filter $filter) {}, $filters); |
|
75 | + array_map(function(Filter $filter) {}, $filters); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | private function sanitizeFilters(array $filters): array |
79 | 79 | { |
80 | 80 | $existingQueryKeys = []; |
81 | 81 | |
82 | - foreach(array_reverse($filters, true) as $index => $filter) { |
|
82 | + foreach (array_reverse($filters, true) as $index => $filter) { |
|
83 | 83 | |
84 | - if(in_array($filter->queryKey(), $existingQueryKeys)) { |
|
84 | + if (in_array($filter->queryKey(), $existingQueryKeys)) { |
|
85 | 85 | unset($filters[$index]); |
86 | 86 | continue; |
87 | 87 | } |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class FilterType |
8 | 8 | { |
9 | - const HIDDEN = 'hidden'; // hidden input - default sorting or filtering without admin manipulation possible |
|
10 | - const INPUT = 'input'; // oneliner text (input) |
|
11 | - const SELECT = 'select'; // Select options |
|
9 | + const HIDDEN = 'hidden'; // hidden input - default sorting or filtering without admin manipulation possible |
|
10 | + const INPUT = 'input'; // oneliner text (input) |
|
11 | + const SELECT = 'select'; // Select options |
|
12 | 12 | const CHECKBOX = 'checkbox'; |
13 | 13 | const RADIO = 'radio'; |
14 | 14 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | foreach ($replacements as $replacement) { |
97 | - $newKeySet[] = str_replace(':' . $placeholder, $replacement, $key); |
|
97 | + $newKeySet[] = str_replace(':'.$placeholder, $replacement, $key); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | |
143 | 143 | // Remove all 'trans' entries for this locale |
144 | 144 | foreach ($filteredKeys as $i => $key) { |
145 | - if (Str::startsWith($key, 'trans.' . $locale)) { |
|
145 | + if (Str::startsWith($key, 'trans.'.$locale)) { |
|
146 | 146 | unset($filteredKeys[$i]); |
147 | 147 | } |
148 | 148 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $payload = Arr::get($this->payload, $key, '_notfound_'); |
164 | 164 | |
165 | 165 | // If the payload is empty and this is not the entry for the required locale |
166 | - if ($payload !== '_notfound_' && !$payload && !Str::endsWith($key, '.' . $this->requiredLocale)) { |
|
166 | + if ($payload !== '_notfound_' && !$payload && !Str::endsWith($key, '.'.$this->requiredLocale)) { |
|
167 | 167 | unset($filteredKeys[$i]); |
168 | 168 | } |
169 | 169 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if (isset($customRules[$rule])) { |
52 | - $rules[$k] = $customRules[$rule] . ($params ? ':' . $params : ''); |
|
52 | + $rules[$k] = $customRules[$rule].($params ? ':'.$params : ''); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | { |
21 | 21 | return (new static(new FieldType(FieldType::IMAGE), $key)) |
22 | 22 | ->locales([config('app.fallback_locale', 'nl')]) |
23 | - ->valueResolver(function ($model = null, $locale = null, ImageField $field) { |
|
23 | + ->valueResolver(function($model = null, $locale = null, ImageField $field) { |
|
24 | 24 | return $field->getMedia($model, $locale); |
25 | 25 | }); |
26 | 26 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $images = []; |
40 | 40 | $locale = $locale ?? app()->getLocale(); |
41 | 41 | |
42 | - $assets = $model->assetRelation->where('pivot.type', $this->getKey())->filter(function ($asset) use ($locale) { |
|
42 | + $assets = $model->assetRelation->where('pivot.type', $this->getKey())->filter(function($asset) use ($locale) { |
|
43 | 43 | return $asset->pivot->locale == $locale; |
44 | 44 | })->sortBy('pivot.order'); |
45 | 45 |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | */ |
264 | 264 | private function defaultEloquentValueResolver(): \Closure |
265 | 265 | { |
266 | - return function (Model $model = null, $locale = null) { |
|
266 | + return function(Model $model = null, $locale = null) { |
|
267 | 267 | if ($this->value) { |
268 | 268 | return $this->value; |
269 | 269 | } |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | return $this->isLocalized() |
422 | 422 | ? 'chief::back._formgroups.fieldgroup_translatable' |
423 | - : 'chief::back._fields.' . $this->type->get(); |
|
423 | + : 'chief::back._fields.'.$this->type->get(); |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | public function viewData(array $viewData = []): Field |