We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | foreach (app('UploadersRepository')->getRepeatableUploadersFor($this->getRepeatableContainerName()) as $uploader) { |
| 77 | 77 | $uploadedValues = $uploader->uploadRepeatableFiles($values->pluck($uploader->getName())->toArray(), $this->getPreviousRepeatableValues($entry, $uploader)); |
| 78 | 78 | |
| 79 | - $values = $values->map(function ($item, $key) use ($uploadedValues, $uploader) { |
|
| 79 | + $values = $values->map(function($item, $key) use ($uploadedValues, $uploader) { |
|
| 80 | 80 | $item[$uploader->getName()] = $uploadedValues[$key] ?? null; |
| 81 | 81 | |
| 82 | 82 | return $item; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | $values = $entry->{$this->getRepeatableContainerName()}; |
| 98 | 98 | $values = is_string($values) ? json_decode($values, true) : $values; |
| 99 | - $values = array_map(function ($item) use ($repeatableUploaders) { |
|
| 99 | + $values = array_map(function($item) use ($repeatableUploaders) { |
|
| 100 | 100 | foreach ($repeatableUploaders as $upload) { |
| 101 | 101 | $item[$upload->getName()] = $this->getValuesWithPathStripped($item, $upload); |
| 102 | 102 | } |
@@ -119,12 +119,12 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | $repeatableValues = collect($entry->{$this->getName()}); |
| 121 | 121 | foreach (app('UploadersRepository')->getRepeatableUploadersFor($this->getRepeatableContainerName()) as $upload) { |
| 122 | - if (! $upload->shouldDeleteFiles()) { |
|
| 122 | + if (!$upload->shouldDeleteFiles()) { |
|
| 123 | 123 | continue; |
| 124 | 124 | } |
| 125 | 125 | $values = $repeatableValues->pluck($upload->getName())->toArray(); |
| 126 | 126 | foreach ($values as $value) { |
| 127 | - if (! $value) { |
|
| 127 | + if (!$value) { |
|
| 128 | 128 | continue; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | /** |
| 148 | 148 | * Given two multidimensional arrays/collections, merge them recursively. |
| 149 | 149 | */ |
| 150 | - protected function mergeValuesRecursive(array|Collection $array1, array|Collection $array2): array|Collection |
|
| 150 | + protected function mergeValuesRecursive(array | Collection $array1, array | Collection $array2): array | Collection |
|
| 151 | 151 | { |
| 152 | 152 | $merged = $array1; |
| 153 | 153 | foreach ($array2 as $key => &$value) { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | { |
| 170 | 170 | $items = CRUD::getRequest()->input('_order_'.$this->getRepeatableContainerName()) ?? []; |
| 171 | 171 | |
| 172 | - array_walk($items, function (&$key, $value) { |
|
| 172 | + array_walk($items, function(&$key, $value) { |
|
| 173 | 173 | $requestValue = $key[$this->getName()] ?? null; |
| 174 | 174 | $key = $this->handleMultipleFiles ? (is_string($requestValue) ? explode(',', $requestValue) : $requestValue) : $requestValue; |
| 175 | 175 | }); |
@@ -181,16 +181,16 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | $previousValues = json_decode($entry->getOriginal($uploader->getRepeatableContainerName()), true); |
| 183 | 183 | |
| 184 | - if (! empty($previousValues)) { |
|
| 184 | + if (!empty($previousValues)) { |
|
| 185 | 185 | $previousValues = array_column($previousValues, $uploader->getName()); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | return $previousValues ?? []; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | - private function getValuesWithPathStripped(array|string|null $item, UploaderInterface $upload) { |
|
| 191 | + private function getValuesWithPathStripped(array | string | null $item, UploaderInterface $upload) { |
|
| 192 | 192 | $uploadedValues = $item[$upload->getName()] ?? null; |
| 193 | - if(is_array($uploadedValues)) { |
|
| 193 | + if (is_array($uploadedValues)) { |
|
| 194 | 194 | return array_map(function($value) use ($upload) { |
| 195 | 195 | return Str::after($value, $upload->getPath()); |
| 196 | 196 | },$uploadedValues); |