We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public FileNameGeneratorInterface $fileNameGenerator; |
| 14 | 14 | |
| 15 | - public function getFileName(string|UploadedFile|File $file): string |
|
| 15 | + public function getFileName(string | UploadedFile | File $file): string |
|
| 16 | 16 | { |
| 17 | 17 | if ($this->fileName) { |
| 18 | 18 | return is_callable($this->fileName) ? ($this->fileName)($file, $this) : $this->fileName; |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | { |
| 26 | 26 | $fileGeneratorClass = $fileNameGenerator ?? config('backpack.crud.file_name_generator'); |
| 27 | 27 | |
| 28 | - if (! class_exists($fileGeneratorClass)) { |
|
| 28 | + if (!class_exists($fileGeneratorClass)) { |
|
| 29 | 29 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] does not exist."); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if (! in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
|
| 32 | + if (!in_array(FileNameGeneratorInterface::class, class_implements($fileGeneratorClass, false))) { |
|
| 33 | 33 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] must implement the [".FileNameGeneratorInterface::class.'] interface.'); |
| 34 | 34 | } |
| 35 | 35 | |
@@ -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_a($file, File::class, true)) { |
| 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)); |