We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function up(): void |
13 | 13 | { |
14 | - Schema::create('uploaders', function (Blueprint $table) { |
|
14 | + Schema::create('uploaders', function(Blueprint $table) { |
|
15 | 15 | $table->increments('id'); |
16 | 16 | $table->string('upload')->nullable(); |
17 | 17 | $table->string('image')->nullable(); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | { |
27 | 27 | $connection = $connection ?: config('database.default'); |
28 | 28 | |
29 | - self::$schema[$connection] = LazyCollection::make(self::getCreateSchema($connection)->getTables())->mapWithKeys(function ($table, $key) use ($connection) { |
|
29 | + self::$schema[$connection] = LazyCollection::make(self::getCreateSchema($connection)->getTables())->mapWithKeys(function($table, $key) use ($connection) { |
|
30 | 30 | $tableName = is_array($table) ? $table['name'] : $table->getName(); |
31 | 31 | |
32 | 32 | if ($existingTable = self::$schema[$connection][$tableName] ?? false) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | private static function generateDatabaseSchema(string $connection, string $table) |
67 | 67 | { |
68 | - if (! isset(self::$schema[$connection][$table])) { |
|
68 | + if (!isset(self::$schema[$connection][$table])) { |
|
69 | 69 | self::$schema[$connection][$table] = self::mapTable($connection, $table); |
70 | 70 | } |
71 | 71 | } |
@@ -74,13 +74,12 @@ discard block |
||
74 | 74 | { |
75 | 75 | try { |
76 | 76 | $table = method_exists(self::getCreateSchema($connection), 'getTable') ? |
77 | - self::getCreateSchema($connection)->getTable($tableName) : |
|
78 | - self::getCreateSchema($connection)->getColumns($tableName); |
|
77 | + self::getCreateSchema($connection)->getTable($tableName) : self::getCreateSchema($connection)->getColumns($tableName); |
|
79 | 78 | } catch (\Exception $e) { |
80 | 79 | return new Table($tableName, []); |
81 | 80 | } |
82 | 81 | |
83 | - if (! is_array($table)) { |
|
82 | + if (!is_array($table)) { |
|
84 | 83 | return $table; |
85 | 84 | } |
86 | 85 | |
@@ -91,7 +90,7 @@ discard block |
||
91 | 90 | $schemaManager = self::getSchemaManager($connection); |
92 | 91 | $indexes = $schemaManager->getIndexes($tableName); |
93 | 92 | |
94 | - $indexes = array_map(function ($index) { |
|
93 | + $indexes = array_map(function($index) { |
|
95 | 94 | return $index['columns']; |
96 | 95 | }, $indexes); |
97 | 96 | |
@@ -109,7 +108,7 @@ discard block |
||
109 | 108 | |
110 | 109 | $indexes = self::$schema[$connection][$table]->getIndexes(); |
111 | 110 | |
112 | - $indexes = \Illuminate\Support\Arr::flatten(array_map(function ($index) { |
|
111 | + $indexes = \Illuminate\Support\Arr::flatten(array_map(function($index) { |
|
113 | 112 | return is_string($index) ? $index : $index->getColumns(); |
114 | 113 | }, $indexes)); |
115 | 114 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function markAsHandled(string $objectName): void |
36 | 36 | { |
37 | - if (! in_array($objectName, $this->handledUploaders)) { |
|
37 | + if (!in_array($objectName, $this->handledUploaders)) { |
|
38 | 38 | $this->handledUploaders[] = $objectName; |
39 | 39 | } |
40 | 40 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function getUploadFor(string $objectType, string $group): string |
62 | 62 | { |
63 | - if (! $this->hasUploadFor($objectType, $group)) { |
|
63 | + if (!$this->hasUploadFor($objectType, $group)) { |
|
64 | 64 | throw new \Exception('There is no uploader defined for the given field type.'); |
65 | 65 | } |
66 | 66 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | // ensure all uploaders implement the UploaderInterface |
84 | 84 | foreach ($uploaders as $uploader) { |
85 | - if (! is_a($uploader, UploaderInterface::class, true)) { |
|
85 | + if (!is_a($uploader, UploaderInterface::class, true)) { |
|
86 | 86 | throw new \Exception('The uploader class must implement the UploaderInterface.'); |
87 | 87 | } |
88 | 88 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function registerRepeatableUploader(string $uploadName, UploaderInterface $uploader): void |
104 | 104 | { |
105 | - if (! array_key_exists($uploadName, $this->repeatableUploaders) || ! in_array($uploader, $this->repeatableUploaders[$uploadName])) { |
|
105 | + if (!array_key_exists($uploadName, $this->repeatableUploaders) || !in_array($uploader, $this->repeatableUploaders[$uploadName])) { |
|
106 | 106 | $this->repeatableUploaders[$uploadName][] = $uploader; |
107 | 107 | } |
108 | 108 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function getRegisteredUploadNames(string $uploadName): array |
138 | 138 | { |
139 | - return array_map(function ($uploader) { |
|
139 | + return array_map(function($uploader) { |
|
140 | 140 | return $uploader->getName(); |
141 | 141 | }, $this->getRepeatableUploadersFor($uploadName)); |
142 | 142 | } |
@@ -167,11 +167,11 @@ discard block |
||
167 | 167 | |
168 | 168 | $uploaders = $this->getRepeatableUploadersFor($repeatableContainerName); |
169 | 169 | |
170 | - $uploader = Arr::first($uploaders, function ($uploader) use ($requestInputName) { |
|
170 | + $uploader = Arr::first($uploaders, function($uploader) use ($requestInputName) { |
|
171 | 171 | return $uploader->getName() === $requestInputName; |
172 | 172 | }); |
173 | 173 | |
174 | - if (! $uploader) { |
|
174 | + if (!$uploader) { |
|
175 | 175 | abort(500, 'Could not find the field in the repeatable uploaders.'); |
176 | 176 | } |
177 | 177 | |
@@ -182,16 +182,16 @@ discard block |
||
182 | 182 | abort(500, 'Could not find the field in the CRUD fields.'); |
183 | 183 | } |
184 | 184 | |
185 | - if (! $uploaderMacro = $this->getUploadCrudObjectMacroType($crudObject)) { |
|
185 | + if (!$uploaderMacro = $this->getUploadCrudObjectMacroType($crudObject)) { |
|
186 | 186 | abort(500, 'There is no uploader defined for the given field type.'); |
187 | 187 | } |
188 | 188 | |
189 | - if (! $this->isValidUploadField($crudObject, $uploaderMacro)) { |
|
189 | + if (!$this->isValidUploadField($crudObject, $uploaderMacro)) { |
|
190 | 190 | abort(500, 'Invalid field for upload.'); |
191 | 191 | } |
192 | 192 | |
193 | 193 | $uploaderConfiguration = $crudObject[$uploaderMacro] ?? []; |
194 | - $uploaderConfiguration = ! is_array($uploaderConfiguration) ? [] : $uploaderConfiguration; |
|
194 | + $uploaderConfiguration = !is_array($uploaderConfiguration) ? [] : $uploaderConfiguration; |
|
195 | 195 | $uploaderClass = $this->getUploadFor($crudObject['type'], $uploaderMacro); |
196 | 196 | |
197 | 197 | return new $uploaderClass(['name' => $requestInputName], $uploaderConfiguration); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | /** |
201 | 201 | * Get the upload field macro type for the given object. |
202 | 202 | */ |
203 | - private function getUploadCrudObjectMacroType(array $crudObject): string|null |
|
203 | + private function getUploadCrudObjectMacroType(array $crudObject): string | null |
|
204 | 204 | { |
205 | 205 | $uploadersGroups = $this->getUploadersGroupsNames(); |
206 | 206 | |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | { |
218 | 218 | if (Str::contains($crudObject['name'], '#')) { |
219 | 219 | $container = Str::before($crudObject['name'], '#'); |
220 | - $field = array_filter(CRUD::fields()[$container]['subfields'] ?? [], function ($item) use ($crudObject, $uploaderMacro) { |
|
220 | + $field = array_filter(CRUD::fields()[$container]['subfields'] ?? [], function($item) use ($crudObject, $uploaderMacro) { |
|
221 | 221 | return $item['name'] === $crudObject['name'] && in_array($item['type'], $this->getAjaxUploadTypes($uploaderMacro)); |
222 | 222 | }); |
223 | 223 | |
224 | - return ! empty($field); |
|
224 | + return !empty($field); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | return in_array($crudObject['type'], $this->getAjaxUploadTypes($uploaderMacro)); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | return $this->getPath().$fileName; |
30 | 30 | } |
31 | 31 | |
32 | - if (! $value && CrudPanelFacade::getRequest()->has($this->getNameForRequest()) && $previousFile) { |
|
32 | + if (!$value && CrudPanelFacade::getRequest()->has($this->getNameForRequest()) && $previousFile) { |
|
33 | 33 | Storage::disk($this->getDisk())->delete($previousFile); |
34 | 34 | |
35 | 35 | return null; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | foreach ($previousRepeatableValues as $row => $file) { |
57 | 57 | if ($file) { |
58 | - if (! isset($orderedFiles[$row])) { |
|
58 | + if (!isset($orderedFiles[$row])) { |
|
59 | 59 | $orderedFiles[$row] = null; |
60 | 60 | } |
61 | 61 | if (!in_array($file, $orderedFiles)) { |