We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $this->crudObjectType = $crudObject['crudObjectType']; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public static function for(array $crudObject) |
|
| 27 | + public static function for (array $crudObject) |
|
| 28 | 28 | { |
| 29 | 29 | if (isset($crudObject['relation_type']) && $crudObject['entity'] !== false) { |
| 30 | 30 | return new RepeatableRelationship($crudObject); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function uploads(...$uploads): self |
| 37 | 37 | { |
| 38 | 38 | foreach ($uploads as $upload) { |
| 39 | - if (! is_a($upload, UploaderInterface::class)) { |
|
| 39 | + if (!is_a($upload, UploaderInterface::class)) { |
|
| 40 | 40 | throw new \Exception('Uploads must be an instance of UploaderInterface.'); |
| 41 | 41 | } |
| 42 | 42 | $this->repeatableUploads[] = $upload->repeats($this->name)->relationship($this->isRelationship ?? false); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | { |
| 66 | 66 | $uploadedValues = $upload->save($entry, $value->pluck($upload->getName())->toArray()); |
| 67 | 67 | |
| 68 | - $value = $value->map(function ($item, $key) use ($upload, $uploadedValues) { |
|
| 68 | + $value = $value->map(function($item, $key) use ($upload, $uploadedValues) { |
|
| 69 | 69 | $item[$upload->getName()] = $uploadedValues[$key] ?? null; |
| 70 | 70 | |
| 71 | 71 | return $item; |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | $crudField = CRUD::field($this->name); |
| 80 | 80 | |
| 81 | 81 | $subfields = collect($crudField->getAttributes()['subfields']); |
| 82 | - $subfields = $subfields->map(function ($item) { |
|
| 82 | + $subfields = $subfields->map(function($item) { |
|
| 83 | 83 | if (isset($item['withMedia']) || isset($item['withUploads'])) { |
| 84 | 84 | /** @var UploaderInterface $uploader */ |
| 85 | - $uploader = array_filter($this->repeatableUploads, function ($item) { |
|
| 85 | + $uploader = array_filter($this->repeatableUploads, function($item) { |
|
| 86 | 86 | return $item->name !== $this->name; |
| 87 | 87 | })[0]; |
| 88 | 88 | $item['upload'] = true; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | public function processFileUpload(Model $entry) |
| 104 | 104 | { |
| 105 | - if (! $this->isRelationship) { |
|
| 105 | + if (!$this->isRelationship) { |
|
| 106 | 106 | $entry->{$this->name} = json_encode($this->save($entry)); |
| 107 | 107 | } else { |
| 108 | 108 | $entry = $this->save($entry); |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | { |
| 131 | 131 | $repeatableValues = collect($entry->{$this->getName()}); |
| 132 | 132 | foreach ($this->repeatableUploads as $upload) { |
| 133 | - if (! $upload->deleteWhenEntryIsDeleted) { |
|
| 133 | + if (!$upload->deleteWhenEntryIsDeleted) { |
|
| 134 | 134 | continue; |
| 135 | 135 | } |
| 136 | 136 | $values = $repeatableValues->pluck($upload->getName())->toArray(); |
| 137 | 137 | foreach ($values as $value) { |
| 138 | - if (! $value) { |
|
| 138 | + if (!$value) { |
|
| 139 | 139 | continue; |
| 140 | 140 | } |
| 141 | 141 | if (is_array($value)) { |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | $values = $entry->{$upload->name}; |
| 55 | 55 | |
| 56 | 56 | if ($upload->isMultiple) { |
| 57 | - if (! isset($entry->getCasts()[$upload->name]) && is_string($values)) { |
|
| 57 | + if (!isset($entry->getCasts()[$upload->name]) && is_string($values)) { |
|
| 58 | 58 | $values = json_decode($values, true); |
| 59 | 59 | } |
| 60 | 60 | } else { |
@@ -9,14 +9,14 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class MultipleFiles extends Uploader |
| 11 | 11 | { |
| 12 | - public static function for(array $field, $configuration) |
|
| 12 | + public static function for (array $field, $configuration) |
|
| 13 | 13 | { |
| 14 | 14 | return (new self($field, $configuration))->multiple(); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function save(Model $entry, $value = null) |
| 18 | 18 | { |
| 19 | - return $this->isRepeatable && ! $this->isRelationship ? $this->saveRepeatableMutipleFiles($entry, $value) : $this->saveMultipleFiles($entry, $value); |
|
| 19 | + return $this->isRepeatable && !$this->isRelationship ? $this->saveRepeatableMutipleFiles($entry, $value) : $this->saveMultipleFiles($entry, $value); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | private function saveMultipleFiles($entry, $value = null) |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | $previousFiles = $entry->getOriginal($this->name) ?? []; |
| 29 | 29 | |
| 30 | - if (! is_array($previousFiles) && is_string($previousFiles)) { |
|
| 30 | + if (!is_array($previousFiles) && is_string($previousFiles)) { |
|
| 31 | 31 | $previousFiles = json_decode($previousFiles, true); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | if (in_array($previousFile, $filesToDelete)) { |
| 37 | 37 | Storage::disk($this->disk)->delete($previousFile); |
| 38 | 38 | |
| 39 | - $previousFiles = Arr::where($previousFiles, function ($value, $key) use ($previousFile) { |
|
| 39 | + $previousFiles = Arr::where($previousFiles, function($value, $key) use ($previousFile) { |
|
| 40 | 40 | return $value != $previousFile; |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function save(Model $entry, $value = null) |
| 12 | 12 | { |
| 13 | - return $this->isRepeatable && ! $this->isRelationship ? $this->saveRepeatableFile($entry, $value) : $this->saveFile($entry, $value); |
|
| 13 | + return $this->isRepeatable && !$this->isRelationship ? $this->saveRepeatableFile($entry, $value) : $this->saveFile($entry, $value); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | private function saveRepeatableFile($entry, $values) |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | foreach ($previousFiles as $row => $file) { |
| 34 | - if ($file && ! isset($orderedFiles[$row])) { |
|
| 34 | + if ($file && !isset($orderedFiles[$row])) { |
|
| 35 | 35 | $orderedFiles[$row] = null; |
| 36 | 36 | Storage::disk($this->disk)->delete($file); |
| 37 | 37 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return $this->path.$fileName; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if (! $value && CrudPanelFacade::getRequest()->has($this->name) && $previousFile) { |
|
| 60 | + if (!$value && CrudPanelFacade::getRequest()->has($this->name) && $previousFile) { |
|
| 61 | 61 | Storage::disk($this->disk)->delete($previousFile); |
| 62 | 62 | |
| 63 | 63 | return null; |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function deleteUploadedFile(Model $entry); |
| 14 | 14 | |
| 15 | - public static function for(array $field, array $configuration); |
|
| 15 | + public static function for (array $field, array $configuration); |
|
| 16 | 16 | |
| 17 | 17 | public function __construct(array $crudObject, array $configuration); |
| 18 | 18 | |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | public function uploads(...$uploads): self; |
| 10 | 10 | |
| 11 | - public static function for(array $field); |
|
| 11 | + public static function for (array $field); |
|
| 12 | 12 | |
| 13 | 13 | public function processFileUpload(Model $entry); |
| 14 | 14 | |
@@ -66,24 +66,24 @@ discard block |
||
| 66 | 66 | include_once __DIR__.'/macros.php'; |
| 67 | 67 | |
| 68 | 68 | // Bind the CrudPanel object to Laravel's service container |
| 69 | - $this->app->scoped('crud', function ($app) { |
|
| 69 | + $this->app->scoped('crud', function($app) { |
|
| 70 | 70 | return new CrudPanel(); |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | - $this->app->scoped('DatabaseSchema', function ($app) { |
|
| 73 | + $this->app->scoped('DatabaseSchema', function($app) { |
|
| 74 | 74 | return new DatabaseSchema(); |
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | - $this->app->singleton('BackpackViewNamespaces', function ($app) { |
|
| 77 | + $this->app->singleton('BackpackViewNamespaces', function($app) { |
|
| 78 | 78 | return new ViewNamespaces(); |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | 81 | // Bind the widgets collection object to Laravel's service container |
| 82 | - $this->app->singleton('widgets', function ($app) { |
|
| 82 | + $this->app->singleton('widgets', function($app) { |
|
| 83 | 83 | return new Collection(); |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | - $this->app->scoped('UploadStore', function ($app) { |
|
| 86 | + $this->app->scoped('UploadStore', function($app) { |
|
| 87 | 87 | return new UploadStore(); |
| 88 | 88 | }); |
| 89 | 89 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $middleware_key = config('backpack.base.middleware_key'); |
| 100 | 100 | $middleware_class = config('backpack.base.middleware_class'); |
| 101 | 101 | |
| 102 | - if (! is_array($middleware_class)) { |
|
| 102 | + if (!is_array($middleware_class)) { |
|
| 103 | 103 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
| 104 | 104 | |
| 105 | 105 | return; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $operationConfigs = scandir(__DIR__.'/config/backpack/operations/'); |
| 216 | 216 | $operationConfigs = array_diff($operationConfigs, ['.', '..']); |
| 217 | 217 | |
| 218 | - if (! count($operationConfigs)) { |
|
| 218 | + if (!count($operationConfigs)) { |
|
| 219 | 219 | return; |
| 220 | 220 | } |
| 221 | 221 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | { |
| 193 | 193 | $value = $entry->{$this->name}; |
| 194 | 194 | |
| 195 | - if ($this->isMultiple && ! isset($entry->getCasts()[$this->name]) && is_string($value)) { |
|
| 195 | + if ($this->isMultiple && !isset($entry->getCasts()[$this->name]) && is_string($value)) { |
|
| 196 | 196 | $entry->{$this->name} = json_decode($value, true); |
| 197 | 197 | } else { |
| 198 | 198 | $entry->{$this->name} = Str::after($value, $this->path); |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $values = $entry->{$this->name}; |
| 213 | 213 | |
| 214 | 214 | if ($this->isMultiple) { |
| 215 | - if (! isset($entry->getCasts()[$this->name]) && is_string($values)) { |
|
| 215 | + if (!isset($entry->getCasts()[$this->name]) && is_string($values)) { |
|
| 216 | 216 | $values = json_decode($values, true); |
| 217 | 217 | } |
| 218 | 218 | } else { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * @param array $definition |
| 232 | 232 | * @return self |
| 233 | 233 | */ |
| 234 | - public static function for(array $crudObject, array $definition) |
|
| 234 | + public static function for (array $crudObject, array $definition) |
|
| 235 | 235 | { |
| 236 | 236 | return new static($crudObject, $definition); |
| 237 | 237 | } |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | { |
| 295 | 295 | $items = CRUD::getRequest()->input('_order_'.$this->repeatableContainerName) ?? []; |
| 296 | 296 | |
| 297 | - array_walk($items, function (&$key, $value) { |
|
| 297 | + array_walk($items, function(&$key, $value) { |
|
| 298 | 298 | $requestValue = $key[$this->name] ?? null; |
| 299 | 299 | $key = $this->isMultiple ? (is_string($requestValue) ? explode(',', $requestValue) : $requestValue) : $requestValue; |
| 300 | 300 | }); |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | protected function getPreviousRepeatableValues(Model $entry) |
| 322 | 322 | { |
| 323 | 323 | $previousValues = json_decode($entry->getOriginal($this->repeatableContainerName), true); |
| 324 | - if (! empty($previousValues)) { |
|
| 324 | + if (!empty($previousValues)) { |
|
| 325 | 325 | $previousValues = array_column($previousValues, $this->name); |
| 326 | 326 | } |
| 327 | 327 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | * @param CrudField|CrudColumn $macroable |
| 36 | 36 | * @return void |
| 37 | 37 | */ |
| 38 | - private function callRegisteredAttributeMacros(CrudField|CrudColumn $macroable) |
|
| 38 | + private function callRegisteredAttributeMacros(CrudField | CrudColumn $macroable) |
|
| 39 | 39 | { |
| 40 | 40 | $macros = $macroable->getMacros(); |
| 41 | 41 | $attributes = $macroable->getAttributes(); |