We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | ], |
71 | 71 | |
72 | 72 | // CSS files that are loaded in all pages, using Laravel's mix() helper |
73 | - 'mix_styles' => [ // file_path => manifest_directory_path |
|
73 | + 'mix_styles' => [// file_path => manifest_directory_path |
|
74 | 74 | // 'css/app.css' => '', |
75 | 75 | ], |
76 | 76 | |
77 | 77 | // CSS files that are loaded in all pages, using Laravel's @vite() helper |
78 | 78 | // Please note that support for Vite was added in Laravel 9.19. Earlier versions are not able to use this feature. |
79 | - 'vite_styles' => [ // resource file_path |
|
79 | + 'vite_styles' => [// resource file_path |
|
80 | 80 | // 'resources/css/app.css' => '', |
81 | 81 | ], |
82 | 82 | |
@@ -152,12 +152,12 @@ discard block |
||
152 | 152 | ], |
153 | 153 | |
154 | 154 | // JS files that are loaded in all pages, using Laravel's mix() helper |
155 | - 'mix_scripts' => [ // file_path => manifest_directory_path |
|
155 | + 'mix_scripts' => [// file_path => manifest_directory_path |
|
156 | 156 | // 'js/app.js' => '', |
157 | 157 | ], |
158 | 158 | |
159 | 159 | // JS files that are loaded in all pages, using Laravel's @vite() helper |
160 | - 'vite_scripts' => [ // resource file_path |
|
160 | + 'vite_scripts' => [// resource file_path |
|
161 | 161 | // 'resources/js/app.js', |
162 | 162 | ], |
163 | 163 |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | } |
159 | 159 | $type = $this->type; |
160 | - $paths = array_map(function ($item) use ($type) { |
|
160 | + $paths = array_map(function($item) use ($type) { |
|
161 | 161 | return $item.'.'.$type; |
162 | 162 | }, ViewNamespaces::getWithFallbackFor('widgets', 'backpack.ui.component_view_namespaces.widgets')); |
163 | 163 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | // if no view exists, in any of the directories above... no bueno |
170 | - if (! backpack_pro()) { |
|
170 | + if (!backpack_pro()) { |
|
171 | 171 | throw new BackpackProRequiredException('Cannot find the widget view: '.$this->type.'. Please check for typos.'.(backpack_pro() ? '' : ' If you are trying to use a PRO widget, please first purchase and install the backpack/pro addon from backpackforlaravel.com'), 1); |
172 | 172 | } |
173 | 173 | abort(500, 'Cannot find the view for «'.$this->type.'» widget type. Please check for typos.'); |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | { |
254 | 254 | $itemExists = $this->collection()->contains('name', $this->attributes['name']); |
255 | 255 | |
256 | - if (! $itemExists) { |
|
256 | + if (!$itemExists) { |
|
257 | 257 | $this->collection()->put($this->attributes['name'], $this); |
258 | 258 | } else { |
259 | 259 | $this->collection()[$this->name] = $this; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | return $this->getPath().$fileName; |
24 | 24 | } |
25 | 25 | |
26 | - if (! $value && CrudPanelFacade::getRequest()->has($this->getName()) && $previousFile) { |
|
26 | + if (!$value && CrudPanelFacade::getRequest()->has($this->getName()) && $previousFile) { |
|
27 | 27 | Storage::disk($this->getDisk())->delete($previousFile); |
28 | 28 | |
29 | 29 | return null; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | foreach ($previousRepeatableValues as $row => $file) { |
50 | - if ($file && ! isset($orderedFiles[$row])) { |
|
50 | + if ($file && !isset($orderedFiles[$row])) { |
|
51 | 51 | $orderedFiles[$row] = null; |
52 | 52 | Storage::disk($this->getDisk())->delete($file); |
53 | 53 | } |
@@ -6,5 +6,5 @@ |
||
6 | 6 | |
7 | 7 | interface FileNameGeneratorInterface |
8 | 8 | { |
9 | - public function getName(string|UploadedFile $file): string; |
|
9 | + public function getName(string | UploadedFile $file): string; |
|
10 | 10 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function markAsHandled(string $objectName): void |
33 | 33 | { |
34 | - if (! in_array($objectName, $this->handledUploaders)) { |
|
34 | + if (!in_array($objectName, $this->handledUploaders)) { |
|
35 | 35 | $this->handledUploaders[] = $objectName; |
36 | 36 | } |
37 | 37 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function registerRepeatableUploader(string $uploadName, UploaderInterface $uploader): void |
83 | 83 | { |
84 | - if (! array_key_exists($uploadName, $this->repeatableUploaders) || ! in_array($uploader, $this->repeatableUploaders[$uploadName])) { |
|
84 | + if (!array_key_exists($uploadName, $this->repeatableUploaders) || !in_array($uploader, $this->repeatableUploaders[$uploadName])) { |
|
85 | 85 | $this->repeatableUploaders[$uploadName][] = $uploader; |
86 | 86 | } |
87 | 87 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public function getRegisteredUploadNames(string $uploadName): array |
117 | 117 | { |
118 | - return array_map(function ($uploader) { |
|
118 | + return array_map(function($uploader) { |
|
119 | 119 | return $uploader->getName(); |
120 | 120 | }, $this->getRepeatableUploadersFor($uploadName)); |
121 | 121 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | /** |
11 | 11 | * Static constructor function. |
12 | 12 | */ |
13 | - public static function for(array $field, array $configuration): UploaderInterface; |
|
13 | + public static function for (array $field, array $configuration): UploaderInterface; |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Default implementation functions. |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | public function getExpirationTimeInMinutes(): int; |
45 | 45 | |
46 | - public function getFileName(string|UploadedFile $file): string; |
|
46 | + public function getFileName(string | UploadedFile $file): string; |
|
47 | 47 | |
48 | 48 | public function getRepeatableContainerName(): ?string; |
49 | 49 |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | foreach (app('UploadersRepository')->getRepeatableUploadersFor($this->getRepeatableContainerName()) as $uploader) { |
76 | 76 | $uploadedValues = $uploader->uploadRepeatableFiles($values->pluck($uploader->getName())->toArray(), $this->getPreviousRepeatableValues($entry, $uploader)); |
77 | 77 | |
78 | - $values = $values->map(function ($item, $key) use ($uploadedValues, $uploader) { |
|
78 | + $values = $values->map(function($item, $key) use ($uploadedValues, $uploader) { |
|
79 | 79 | $item[$uploader->getName()] = $uploadedValues[$key] ?? null; |
80 | 80 | |
81 | 81 | return $item; |
@@ -104,12 +104,12 @@ discard block |
||
104 | 104 | |
105 | 105 | $repeatableValues = collect($entry->{$this->getName()}); |
106 | 106 | foreach (app('UploadersRepository')->getRepeatableUploadersFor($this->getRepeatableContainerName()) as $upload) { |
107 | - if (! $upload->shouldDeleteFiles()) { |
|
107 | + if (!$upload->shouldDeleteFiles()) { |
|
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | $values = $repeatableValues->pluck($upload->getName())->toArray(); |
111 | 111 | foreach ($values as $value) { |
112 | - if (! $value) { |
|
112 | + if (!$value) { |
|
113 | 113 | continue; |
114 | 114 | } |
115 | 115 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Given two multidimensional arrays/collections, merge them recursively. |
134 | 134 | */ |
135 | - protected function mergeValuesRecursive(array|Collection $array1, array|Collection $array2): array|Collection |
|
135 | + protected function mergeValuesRecursive(array | Collection $array1, array | Collection $array2): array | Collection |
|
136 | 136 | { |
137 | 137 | $merged = $array1; |
138 | 138 | foreach ($array2 as $key => &$value) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | { |
155 | 155 | $items = CRUD::getRequest()->input('_order_'.$this->getRepeatableContainerName()) ?? []; |
156 | 156 | |
157 | - array_walk($items, function (&$key, $value) { |
|
157 | + array_walk($items, function(&$key, $value) { |
|
158 | 158 | $requestValue = $key[$this->getName()] ?? null; |
159 | 159 | $key = $this->handleMultipleFiles ? (is_string($requestValue) ? explode(',', $requestValue) : $requestValue) : $requestValue; |
160 | 160 | }); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | { |
167 | 167 | $previousValues = json_decode($entry->getOriginal($uploader->getRepeatableContainerName()), true); |
168 | 168 | |
169 | - if (! empty($previousValues)) { |
|
169 | + if (!empty($previousValues)) { |
|
170 | 170 | $previousValues = array_column($previousValues, $uploader->getName()); |
171 | 171 | } |
172 | 172 |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | class FileNameGenerator implements FileNameGeneratorInterface |
11 | 11 | { |
12 | - public function getName(string|UploadedFile|File $file): string |
|
12 | + public function getName(string | UploadedFile | File $file): string |
|
13 | 13 | { |
14 | 14 | if (is_object($file) && get_class($file) === File::class) { |
15 | 15 | return $file->getFileName(); |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | return $this->getFileName($file).'.'.$this->getExtensionFromFile($file); |
19 | 19 | } |
20 | 20 | |
21 | - private function getExtensionFromFile(string|UploadedFile $file): string |
|
21 | + private function getExtensionFromFile(string | UploadedFile $file): string |
|
22 | 22 | { |
23 | 23 | return is_a($file, UploadedFile::class, true) ? $file->extension() : Str::after(mime_content_type($file), '/'); |
24 | 24 | } |
25 | 25 | |
26 | - private function getFileName(string|UploadedFile $file): string |
|
26 | + private function getFileName(string | UploadedFile $file): string |
|
27 | 27 | { |
28 | 28 | if (is_file($file)) { |
29 | 29 | return Str::of($file->getClientOriginalName())->beforeLast('.')->slug()->append('-'.Str::random(4)); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | { |
11 | 11 | public mixed $fileNamer = null; |
12 | 12 | |
13 | - public function getFileName(string|UploadedFile|File $file): string |
|
13 | + public function getFileName(string | UploadedFile | File $file): string |
|
14 | 14 | { |
15 | 15 | return is_callable($this->fileNamer) ? ($this->fileNamer)($file, $this) : $this->fileNamer->getName($file); |
16 | 16 | } |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | { |
20 | 20 | $fileGeneratorClass = $fileNameGenerator ?? config('backpack.crud.file_name_generator'); |
21 | 21 | |
22 | - if (! class_exists($fileGeneratorClass)) { |
|
22 | + if (!class_exists($fileGeneratorClass)) { |
|
23 | 23 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] does not exist."); |
24 | 24 | } |
25 | 25 | |
26 | - if (! in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
|
26 | + if (!in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
|
27 | 27 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] must implement the [".FileNameGeneratorInterface::class.'] interface.'); |
28 | 28 | } |
29 | 29 |