We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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,10 +55,10 @@ 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 | - if (! in_array($file, $orderedFiles)) { |
|
61 | + if (!in_array($file, $orderedFiles)) { |
|
62 | 62 | Storage::disk($this->getDisk())->delete($file); |
63 | 63 | } |
64 | 64 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | // Display general error in case it failed |
74 | - if (! $this->isInstalled()) { |
|
74 | + if (!$this->isInstalled()) { |
|
75 | 75 | $this->errorProgressBlock(); |
76 | 76 | $this->note('For further information please check the log file.'); |
77 | 77 | $this->note('You can also follow the manual installation process documented on GitHub.'); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->progressBlock('Publish theme config file'); |
85 | 85 | |
86 | 86 | // manually include the provider in the run-time |
87 | - if (! class_exists(self::$addon['provider'])) { |
|
87 | + if (!class_exists(self::$addon['provider'])) { |
|
88 | 88 | include self::$addon['provider_path'] ?? self::$addon['path'].'/src/AddonServiceProvider.php'; |
89 | 89 | app()->register(self::$addon['provider']); |
90 | 90 | } |
@@ -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->bigIncrements('id')->unsigned(); |
16 | 16 | $table->string('upload')->nullable(); |
17 | 17 | $table->string('image')->nullable(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | private bool $deleteWhenEntryIsDeleted = true; |
27 | 27 | |
28 | - private bool|string $attachedToFakeField = false; |
|
28 | + private bool | string $attachedToFakeField = false; |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Cloud disks have the ability to generate temporary URLs to files, should we do it? |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /******************************* |
63 | 63 | * Static methods |
64 | 64 | *******************************/ |
65 | - public static function for(array $crudObject, array $definition): UploaderInterface |
|
65 | + public static function for (array $crudObject, array $definition): UploaderInterface |
|
66 | 66 | { |
67 | 67 | return new static($crudObject, $definition); |
68 | 68 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | |
103 | 103 | public function deleteUploadedFiles(Model $entry): void |
104 | 104 | { |
105 | - if (! in_array(SoftDeletes::class, class_uses_recursive($entry), true)) { |
|
105 | + if (!in_array(SoftDeletes::class, class_uses_recursive($entry), true)) { |
|
106 | 106 | $this->performFileDeletion($entry); |
107 | 107 | |
108 | 108 | return; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | public function getPreviousFiles(Model $entry): mixed |
179 | 179 | { |
180 | - if (! $this->attachedToFakeField) { |
|
180 | + if (!$this->attachedToFakeField) { |
|
181 | 181 | return $this->getOriginalValue($entry); |
182 | 182 | } |
183 | 183 | $value = $this->getOriginalValue($entry, $this->attachedToFakeField); |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | return $this->attachedToFakeField !== false; |
197 | 197 | } |
198 | 198 | |
199 | - public function getFakeAttribute(): bool|string |
|
199 | + public function getFakeAttribute(): bool | string |
|
200 | 200 | { |
201 | 201 | return $this->attachedToFakeField; |
202 | 202 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return $this; |
224 | 224 | } |
225 | 225 | |
226 | - public function fake(bool|string $isFake): self |
|
226 | + public function fake(bool | string $isFake): self |
|
227 | 227 | { |
228 | 228 | $this->attachedToFakeField = $isFake; |
229 | 229 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | if ($this->handleMultipleFiles) { |
257 | - if (! isset($entry->getCasts()[$this->getName()]) && is_string($value)) { |
|
257 | + if (!isset($entry->getCasts()[$this->getName()]) && is_string($value)) { |
|
258 | 258 | $entry->{$this->getAttributeName()} = json_decode($value, true); |
259 | 259 | } |
260 | 260 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | |
269 | 269 | protected function deleteFiles(Model $entry) |
270 | 270 | { |
271 | - if (! $this->shouldDeleteFiles()) { |
|
271 | + if (!$this->shouldDeleteFiles()) { |
|
272 | 272 | return; |
273 | 273 | } |
274 | 274 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | |
304 | 304 | private function performFileDeletion(Model $entry) |
305 | 305 | { |
306 | - if (! $this->handleRepeatableFiles && $this->deleteWhenEntryIsDeleted) { |
|
306 | + if (!$this->handleRepeatableFiles && $this->deleteWhenEntryIsDeleted) { |
|
307 | 307 | $this->deleteFiles($entry); |
308 | 308 | |
309 | 309 | return; |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | $previousValue = $entry->getOriginal($field); |
334 | 334 | |
335 | - if (! $previousValue) { |
|
335 | + if (!$previousValue) { |
|
336 | 336 | return $previousValue; |
337 | 337 | } |
338 | 338 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | ]; |
61 | 61 | |
62 | 62 | foreach ($filesToPublish as $destination => $stub) { |
63 | - if (! is_string($destination)) { |
|
63 | + if (!is_string($destination)) { |
|
64 | 64 | $destination = $stub; |
65 | 65 | $stub = null; |
66 | 66 | } |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | continue; |
72 | 72 | } |
73 | 73 | |
74 | - if (! File::isDirectory(dirname($destination))) { |
|
74 | + if (!File::isDirectory(dirname($destination))) { |
|
75 | 75 | File::makeDirectory(dirname($destination), 0755, true); |
76 | 76 | } |
77 | 77 | |
78 | - if (! $stub) { |
|
78 | + if (!$stub) { |
|
79 | 79 | File::copy(__DIR__.'/../../../public/'.basename($destination), $destination); |
80 | 80 | $this->info("File {$destination} published."); |
81 | 81 | continue; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | /** |
75 | 75 | * Add a column at the end of the CRUD object's "columns" array and return it. |
76 | 76 | */ |
77 | - public function addAndReturnColumn(array|string $column): CrudColumn |
|
77 | + public function addAndReturnColumn(array | string $column): CrudColumn |
|
78 | 78 | { |
79 | 79 | $column = $this->prepareAttributesAndAddColumn($column); |
80 | 80 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function makeFirstColumn() |
124 | 124 | { |
125 | - if (! $this->columns()) { |
|
125 | + if (!$this->columns()) { |
|
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function removeColumns($columns) |
168 | 168 | { |
169 | - if (! empty($columns)) { |
|
169 | + if (!empty($columns)) { |
|
170 | 170 | foreach ($columns as $columnKey) { |
171 | 171 | $this->removeColumn($columnKey); |
172 | 172 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | */ |
332 | 332 | public function hasColumnWhere($attribute, $value) |
333 | 333 | { |
334 | - $match = Arr::first($this->columns(), function ($column, $columnKey) use ($attribute, $value) { |
|
334 | + $match = Arr::first($this->columns(), function($column, $columnKey) use ($attribute, $value) { |
|
335 | 335 | return isset($column[$attribute]) && $column[$attribute] == $value; |
336 | 336 | }); |
337 | 337 | |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function firstColumnWhere($attribute, $value) |
349 | 349 | { |
350 | - return Arr::first($this->columns(), function ($column, $columnKey) use ($attribute, $value) { |
|
350 | + return Arr::first($this->columns(), function($column, $columnKey) use ($attribute, $value) { |
|
351 | 351 | return isset($column[$attribute]) && $column[$attribute] == $value; |
352 | 352 | }); |
353 | 353 | } |
@@ -396,8 +396,8 @@ discard block |
||
396 | 396 | */ |
397 | 397 | public function countColumnsWithoutActions() |
398 | 398 | { |
399 | - return collect($this->columns())->filter(function ($column, $key) { |
|
400 | - return ! isset($column['hasActions']) || $column['hasActions'] == false; |
|
399 | + return collect($this->columns())->filter(function($column, $key) { |
|
400 | + return !isset($column['hasActions']) || $column['hasActions'] == false; |
|
401 | 401 | })->count(); |
402 | 402 | } |
403 | 403 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $entry = $this->getCurrentEntry(); |
56 | 56 | |
57 | - if (! $entry) { |
|
57 | + if (!$entry) { |
|
58 | 58 | return false; |
59 | 59 | } |
60 | 60 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function getEntry($id) |
71 | 71 | { |
72 | - if (! $this->entry) { |
|
72 | + if (!$this->entry) { |
|
73 | 73 | if ($this->getOperationSetting('eagerLoadRelationships')) { |
74 | 74 | $this->eagerLoadRelationshipFields(); |
75 | 75 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return $this->entry; |
81 | 81 | } |
82 | 82 | |
83 | - private function shouldUseFallbackLocale(): bool|string |
|
83 | + private function shouldUseFallbackLocale(): bool | string |
|
84 | 84 | { |
85 | 85 | $fallbackRequestValue = $this->getRequest()->get('_fallback_locale'); |
86 | 86 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function getEntryWithLocale($id) |
98 | 98 | { |
99 | - if (! $this->entry) { |
|
99 | + if (!$this->entry) { |
|
100 | 100 | $this->entry = $this->getEntry($id); |
101 | 101 | } |
102 | 102 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | foreach ($crudObjects as $crudObjectName => $attributes) { |
148 | 148 | $relationString = isset($attributes['entity']) && $attributes['entity'] !== false ? $attributes['entity'] : ''; |
149 | 149 | |
150 | - if (! $relationString) { |
|
150 | + if (!$relationString) { |
|
151 | 151 | continue; |
152 | 152 | } |
153 | 153 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function enableDetailsRow() |
215 | 215 | { |
216 | - if (! backpack_pro()) { |
|
216 | + if (!backpack_pro()) { |
|
217 | 217 | throw new BackpackProRequiredException('Details row'); |
218 | 218 | } |
219 | 219 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | // we will apply the same labels as the values to the menu if developer didn't |
313 | 313 | $this->abortIfInvalidPageLength($menu[0]); |
314 | 314 | |
315 | - if (! isset($menu[1]) || ! is_array($menu[1])) { |
|
315 | + if (!isset($menu[1]) || !is_array($menu[1])) { |
|
316 | 316 | $menu[1] = $menu[0]; |
317 | 317 | } |
318 | 318 | } else { |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | */ |
401 | 401 | public function enableExportButtons() |
402 | 402 | { |
403 | - if (! backpack_pro()) { |
|
403 | + if (!backpack_pro()) { |
|
404 | 404 | throw new BackpackProRequiredException('Export buttons'); |
405 | 405 | } |
406 | 406 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | (array) config('backpack.base.middleware_key', 'admin') |
16 | 16 | ), |
17 | 17 | 'namespace' => 'App\Http\Controllers\Admin', |
18 | -], function () { // custom admin routes |
|
18 | +], function() { // custom admin routes |
|
19 | 19 | }); // this should be the absolute last line of this file |
20 | 20 | |
21 | 21 | /** |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | public function testAddButtonFluently() |
277 | 277 | { |
278 | 278 | $button1 = CrudButton::name('lineTest')->to('line')->view('crud::buttons.test')->type('view'); |
279 | - $button2 = CrudButton::add('modelFunction')->model_function(function () { |
|
279 | + $button2 = CrudButton::add('modelFunction')->model_function(function() { |
|
280 | 280 | return 'test'; |
281 | 281 | })->section('top')->makeFirst(); |
282 | 282 | $this->assertEquals($button1->toArray(), $this->crudPanel->buttons()->last()->toArray()); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | $this->expectException(\Symfony\Component\HttpKernel\Exception\HttpException::class); |
292 | 292 | |
293 | - $this->crudPanel->modifyButton('unknownButton', function ($button) { |
|
293 | + $this->crudPanel->modifyButton('unknownButton', function($button) { |
|
294 | 294 | $button->name = 'newName'; |
295 | 295 | }); |
296 | 296 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | |
343 | 343 | private function getButtonByName($name) |
344 | 344 | { |
345 | - return $this->crudPanel->buttons()->first(function ($value) use ($name) { |
|
345 | + return $this->crudPanel->buttons()->first(function($value) use ($name) { |
|
346 | 346 | return $value->name == $name; |
347 | 347 | }); |
348 | 348 | } |