@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ->performedOn($this->manager->existingModel()) |
62 | 62 | ->log('published'); |
63 | 63 | |
64 | - return redirect()->back()->with('messages.success', $this->manager->details()->title . ' is online gezet.'); |
|
64 | + return redirect()->back()->with('messages.success', $this->manager->details()->title.' is online gezet.'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | public function unpublish() |
@@ -75,12 +75,12 @@ discard block |
||
75 | 75 | ->performedOn($this->manager->existingModel()) |
76 | 76 | ->log('unpublished'); |
77 | 77 | |
78 | - return redirect()->back()->with('messages.success', $this->manager->details()->title . ' is offline gehaald.'); |
|
78 | + return redirect()->back()->with('messages.success', $this->manager->details()->title.' is offline gehaald.'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function findAll(): Collection |
82 | 82 | { |
83 | - return $this->manager->existingModel()->published()->get()->map(function ($model) { |
|
83 | + return $this->manager->existingModel()->published()->get()->map(function($model) { |
|
84 | 84 | return $this->managers->findByModel($model); |
85 | 85 | }); |
86 | 86 | } |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | $class = 'text-warning'; |
138 | 138 | } |
139 | 139 | |
140 | - $statusAsLabel = '<span class="' . $class . '">' . $label . '</span>'; |
|
140 | + $statusAsLabel = '<span class="'.$class.'">'.$label.'</span>'; |
|
141 | 141 | |
142 | 142 | if (!$plain && $this->hasPreviewUrl()) { |
143 | - $statusAsLabel = '<a href="' . $this->previewUrl() . '" target="_blank">' . $statusAsLabel . '</a>'; |
|
143 | + $statusAsLabel = '<a href="'.$this->previewUrl().'" target="_blank">'.$statusAsLabel.'</a>'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $statusAsLabel; |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | return $filename; |
142 | 142 | } |
143 | 143 | |
144 | - $extension = substr($filename, strrpos($filename, '.') + 1); |
|
144 | + $extension = substr($filename, strrpos($filename, '.')+1); |
|
145 | 145 | $filename = substr($filename, 0, strrpos($filename, '.')); |
146 | 146 | |
147 | - return Str::slug($filename) . '.' . $extension; |
|
147 | + return Str::slug($filename).'.'.$extension; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | protected function sort(HasAsset $model, MediaField $field, Request $request) |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | $values = isset($fileIdInput[$key]) |
171 | 171 | ? $fileIdInput[$key] |
172 | 172 | : ( |
173 | - isset($fileIdInput['files-' . $key]) |
|
174 | - ? $fileIdInput['files-' . $key] |
|
173 | + isset($fileIdInput['files-'.$key]) |
|
174 | + ? $fileIdInput['files-'.$key] |
|
175 | 175 | : '' |
176 | 176 | ); |
177 | 177 |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $value = is_null($value) ? [] : (is_array($value) ? $value : json_decode($value, true)); |
19 | 19 | |
20 | - return new static((array) $value); |
|
20 | + return new static((array)$value); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function has(string $key): bool |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ->first(); |
38 | 38 | |
39 | 39 | if (!$record) { |
40 | - throw new UrlRecordNotFound('No url record found by slug [' . $slug . '] for locale [' . $locale . '].'); |
|
40 | + throw new UrlRecordNotFound('No url record found by slug ['.$slug.'] for locale ['.$locale.'].'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return $record; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ->first(); |
62 | 62 | |
63 | 63 | if (!$record) { |
64 | - throw new UrlRecordNotFound('No url record found for model [' . $model->getMorphClass() . '@' . $model->id . '] for locale [' . $locale . '].'); |
|
64 | + throw new UrlRecordNotFound('No url record found for model ['.$model->getMorphClass().'@'.$model->id.'] for locale ['.$locale.'].'); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | return $record; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | } |
156 | 156 | |
157 | 157 | if ($ignoredModel) { |
158 | - $builder->whereNotIn('id', function ($query) use ($ignoredModel) { |
|
158 | + $builder->whereNotIn('id', function($query) use ($ignoredModel) { |
|
159 | 159 | $query->select('id') |
160 | 160 | ->from('chief_urls') |
161 | 161 | ->where('model_type', '=', $ignoredModel->getMorphClass()) |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | |
176 | 176 | // Filter out offline urls... TODO: this should be a state that is owned by the url and not the model. |
177 | 177 | // Because of archived pages the mapping can be null so we reject them before we check for online |
178 | - return $records->map(function (UrlRecord $urlRecord) { |
|
178 | + return $records->map(function(UrlRecord $urlRecord) { |
|
179 | 179 | return Morphables::instance($urlRecord->model_type)->find($urlRecord->model_id); |
180 | - })->reject(function ($model) { |
|
180 | + })->reject(function($model) { |
|
181 | 181 | return $model == null; |
182 | - })->reject(function (ProvidesUrl $model) { |
|
182 | + })->reject(function(ProvidesUrl $model) { |
|
183 | 183 | return (method_exists($model, 'isPublished') && !$model->isPublished()); |
184 | 184 | }); |
185 | 185 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $files = $this->filesystem->files($directory); |
30 | 30 | |
31 | - return collect($files)->filter(function ($file) { |
|
31 | + return collect($files)->filter(function($file) { |
|
32 | 32 | return (Str::startsWith($file->getFileName(), 'sitemap-') && Str::endsWith($file->getFileName(), '.xml')); |
33 | 33 | }); |
34 | 34 | } |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $models = UrlRecord::allOnlineModels($locale); |
77 | 77 | |
78 | 78 | $this->urls = $models |
79 | - ->reject(function (ProvidesUrl $model) use ($locale) { |
|
79 | + ->reject(function(ProvidesUrl $model) use ($locale) { |
|
80 | 80 | // In case the url is not found or present for given locale. |
81 | 81 | return !$model->url($locale); |
82 | 82 | }) |
83 | - ->map(function (ProvidesUrl $model) use ($locale, $alternateLocales) { |
|
83 | + ->map(function(ProvidesUrl $model) use ($locale, $alternateLocales) { |
|
84 | 84 | $url = $model->url($locale); |
85 | 85 | |
86 | 86 | $alternateUrls = []; |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | { |
102 | 102 | $pool = new Pool($this->httpClient, $this->crawlableUrlGenerator(), [ |
103 | 103 | 'concurrency' => 5, |
104 | - 'fulfilled' => function (Response $response, $index) { |
|
104 | + 'fulfilled' => function(Response $response, $index) { |
|
105 | 105 | if ($response->getStatusCode() !== \Symfony\Component\HttpFoundation\Response::HTTP_OK) { |
106 | 106 | unset($this->urls[$index]); |
107 | 107 | } |
108 | 108 | }, |
109 | - 'rejected' => function (RequestException $reason, $index) { |
|
109 | + 'rejected' => function(RequestException $reason, $index) { |
|
110 | 110 | unset($this->urls[$index]); |
111 | 111 | }, |
112 | 112 | ]); |
@@ -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 | } |
@@ -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; |
@@ -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 | }); |