We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -31,11 +31,11 @@ |
||
| 31 | 31 | { |
| 32 | 32 | $fileGeneratorClass = $fileNameGenerator ?? config('backpack.crud.file_name_generator'); |
| 33 | 33 | |
| 34 | - if (! class_exists($fileGeneratorClass)) { |
|
| 34 | + if (!class_exists($fileGeneratorClass)) { |
|
| 35 | 35 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] does not exist."); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - if (! class_implements($fileGeneratorClass, FileNameGeneratorInterface::class)) { |
|
| 38 | + if (!class_implements($fileGeneratorClass, FileNameGeneratorInterface::class)) { |
|
| 39 | 39 | throw new \Exception("The file name generator class [{$fileGeneratorClass}] must implement the [".FileNameGeneratorInterface::class.'] interface.'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | foreach (app('UploadersRepository')->getRegisteredUploadersFor($this->repeatableContainerName) as $uploader) { |
| 115 | 115 | $uploadedValues = $uploader->uploadRepeatableFile($entry, $value->pluck($uploader->getName())->toArray()); |
| 116 | 116 | |
| 117 | - $value = $value->map(function ($item, $key) use ($uploadedValues, $uploader) { |
|
| 117 | + $value = $value->map(function($item, $key) use ($uploadedValues, $uploader) { |
|
| 118 | 118 | $item[$uploader->getName()] = $uploadedValues[$key] ?? null; |
| 119 | 119 | |
| 120 | 120 | return $item; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | protected function getPreviousRepeatableValues(Model $entry) |
| 134 | 134 | { |
| 135 | 135 | $previousValues = json_decode($entry->getOriginal($this->repeatableContainerName), true); |
| 136 | - if (! empty($previousValues)) { |
|
| 136 | + if (!empty($previousValues)) { |
|
| 137 | 137 | $previousValues = array_column($previousValues, $this->getName()); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $items = CRUD::getRequest()->input('_order_'.$this->repeatableContainerName) ?? []; |
| 152 | 152 | |
| 153 | - array_walk($items, function (&$key, $value) { |
|
| 153 | + array_walk($items, function(&$key, $value) { |
|
| 154 | 154 | $requestValue = $key[$this->getName()] ?? null; |
| 155 | 155 | $key = $this->isMultiple ? (is_string($requestValue) ? explode(',', $requestValue) : $requestValue) : $requestValue; |
| 156 | 156 | }); |
@@ -189,12 +189,12 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $repeatableValues = collect($entry->{$this->getName()}); |
| 191 | 191 | foreach (app('UploadersRepository')->getRegisteredUploadersFor($this->repeatableContainerName) as $upload) { |
| 192 | - if (! $upload->shouldDeleteFiles()) { |
|
| 192 | + if (!$upload->shouldDeleteFiles()) { |
|
| 193 | 193 | continue; |
| 194 | 194 | } |
| 195 | 195 | $values = $repeatableValues->pluck($upload->getName())->toArray(); |
| 196 | 196 | foreach ($values as $value) { |
| 197 | - if (! $value) { |
|
| 197 | + if (!$value) { |
|
| 198 | 198 | continue; |
| 199 | 199 | } |
| 200 | 200 | if (is_array($value)) { |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | { |
| 185 | 185 | $value = $entry->{$this->name}; |
| 186 | 186 | |
| 187 | - if ($this->isMultiple && ! isset($entry->getCasts()[$this->name]) && is_string($value)) { |
|
| 187 | + if ($this->isMultiple && !isset($entry->getCasts()[$this->name]) && is_string($value)) { |
|
| 188 | 188 | $entry->{$this->name} = json_decode($value, true); |
| 189 | 189 | } else { |
| 190 | 190 | $entry->{$this->name} = Str::after($value, $this->path); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | public function deleteUploadedFile(Model $entry) |
| 203 | 203 | { |
| 204 | 204 | if ($this->deleteWhenEntryIsDeleted) { |
| 205 | - if (! in_array(SoftDeletes::class, class_uses_recursive($entry), true)) { |
|
| 205 | + if (!in_array(SoftDeletes::class, class_uses_recursive($entry), true)) { |
|
| 206 | 206 | $this->performFileDeletion($entry); |
| 207 | 207 | |
| 208 | 208 | return; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $values = $entry->{$this->name}; |
| 226 | 226 | |
| 227 | 227 | if ($this->isMultiple) { |
| 228 | - if (! isset($entry->getCasts()[$this->name]) && is_string($values)) { |
|
| 228 | + if (!isset($entry->getCasts()[$this->name]) && is_string($values)) { |
|
| 229 | 229 | $values = json_decode($values, true); |
| 230 | 230 | } |
| 231 | 231 | } else { |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | */ |
| 247 | 247 | private function performFileDeletion($entry) |
| 248 | 248 | { |
| 249 | - if ($this->isRelationship || ! $this->isRepeatable) { |
|
| 249 | + if ($this->isRelationship || !$this->isRepeatable) { |
|
| 250 | 250 | $this->deleteFiles($entry); |
| 251 | 251 | |
| 252 | 252 | return; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @param array $definition |
| 263 | 263 | * @return self |
| 264 | 264 | */ |
| 265 | - public static function for(array $crudObject, array $definition) |
|
| 265 | + public static function for (array $crudObject, array $definition) |
|
| 266 | 266 | { |
| 267 | 267 | return new static($crudObject, $definition); |
| 268 | 268 | } |