We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | <?php |
28 | 28 | function tree_element($entry, $key, $all_entries, $crud) |
29 | 29 | { |
30 | - if (! isset($entry->tree_element_shown)) { |
|
30 | + if (!isset($entry->tree_element_shown)) { |
|
31 | 31 | // mark the element as shown |
32 | 32 | $all_entries[$key]->tree_element_shown = true; |
33 | 33 | $entry->tree_element_shown = true; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | <ol class="sortable mt-0 mb-0"> |
71 | 71 | <?php |
72 | 72 | $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); |
73 | - $root_entries = $all_entries->filter(function ($item) { |
|
73 | + $root_entries = $all_entries->filter(function($item) { |
|
74 | 74 | return $item->parent_id == 0; |
75 | 75 | }); |
76 | 76 | foreach ($root_entries as $key => $entry) { |
@@ -81,24 +81,24 @@ discard block |
||
81 | 81 | $this->registerBackpackErrorViews(); |
82 | 82 | |
83 | 83 | // Bind the CrudPanel object to Laravel's service container |
84 | - $this->app->scoped('crud', function ($app) { |
|
84 | + $this->app->scoped('crud', function($app) { |
|
85 | 85 | return new CrudPanel(); |
86 | 86 | }); |
87 | 87 | |
88 | - $this->app->scoped('DatabaseSchema', function ($app) { |
|
88 | + $this->app->scoped('DatabaseSchema', function($app) { |
|
89 | 89 | return new DatabaseSchema(); |
90 | 90 | }); |
91 | 91 | |
92 | - $this->app->singleton('BackpackViewNamespaces', function ($app) { |
|
92 | + $this->app->singleton('BackpackViewNamespaces', function($app) { |
|
93 | 93 | return new ViewNamespaces(); |
94 | 94 | }); |
95 | 95 | |
96 | 96 | // Bind the widgets collection object to Laravel's service container |
97 | - $this->app->singleton('widgets', function ($app) { |
|
97 | + $this->app->singleton('widgets', function($app) { |
|
98 | 98 | return new Collection(); |
99 | 99 | }); |
100 | 100 | |
101 | - $this->app->scoped('UploadersRepository', function ($app) { |
|
101 | + $this->app->scoped('UploadersRepository', function($app) { |
|
102 | 102 | return new UploadersRepository(); |
103 | 103 | }); |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $middleware_key = config('backpack.base.middleware_key'); |
115 | 115 | $middleware_class = config('backpack.base.middleware_class'); |
116 | 116 | |
117 | - if (! is_array($middleware_class)) { |
|
117 | + if (!is_array($middleware_class)) { |
|
118 | 118 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
119 | 119 | |
120 | 120 | return; |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | $configs = scandir(__DIR__."/config/backpack/$dir/"); |
228 | 228 | $configs = array_diff($configs, ['.', '..']); |
229 | 229 | |
230 | - if (! count($configs)) { |
|
230 | + if (!count($configs)) { |
|
231 | 231 | return; |
232 | 232 | } |
233 | 233 | |
@@ -326,13 +326,13 @@ discard block |
||
326 | 326 | private function registerBackpackErrorViews() |
327 | 327 | { |
328 | 328 | // register the backpack error when the exception handler is resolved from the container |
329 | - $this->callAfterResolving(ExceptionHandler::class, function ($handler) { |
|
330 | - if (! Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
329 | + $this->callAfterResolving(ExceptionHandler::class, function($handler) { |
|
330 | + if (!Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
331 | 331 | return; |
332 | 332 | } |
333 | 333 | |
334 | 334 | // parse the namespaces set in config |
335 | - [$themeNamespace, $themeFallbackNamespace] = (function () { |
|
335 | + [$themeNamespace, $themeFallbackNamespace] = (function() { |
|
336 | 336 | $themeNamespace = config('backpack.ui.view_namespace'); |
337 | 337 | $themeFallbackNamespace = config('backpack.ui.view_namespace_fallback'); |
338 | 338 | |
@@ -349,8 +349,7 @@ discard block |
||
349 | 349 | // - fallback theme paths |
350 | 350 | // - ui path |
351 | 351 | $themeErrorPaths = $viewFinderHints[$themeNamespace] ?? []; |
352 | - $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : |
|
353 | - array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
352 | + $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
354 | 353 | $uiErrorPaths = [base_path('vendor/backpack/crud/src/resources/views/ui')]; |
355 | 354 | $themeErrorPaths = array_merge($themeErrorPaths, $uiErrorPaths); |
356 | 355 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | use Creativeorange\Gravatar\Facades\Gravatar; |
5 | 5 | use Illuminate\Support\Facades\Log; |
6 | 6 | |
7 | -if (! function_exists('backpack_url')) { |
|
7 | +if (!function_exists('backpack_url')) { |
|
8 | 8 | /** |
9 | 9 | * Appends the configured backpack prefix and returns |
10 | 10 | * the URL using the standard Laravel helpers. |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | */ |
15 | 15 | function backpack_url($path = null, $parameters = [], $secure = null) |
16 | 16 | { |
17 | - $path = ! $path || (substr($path, 0, 1) == '/') ? $path : '/'.$path; |
|
17 | + $path = !$path || (substr($path, 0, 1) == '/') ? $path : '/'.$path; |
|
18 | 18 | |
19 | 19 | return url(config('backpack.base.route_prefix', 'admin').$path, $parameters, $secure); |
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
23 | -if (! function_exists('backpack_authentication_column')) { |
|
23 | +if (!function_exists('backpack_authentication_column')) { |
|
24 | 24 | /** |
25 | 25 | * Return the username column name. |
26 | 26 | * The Laravel default (and Backpack default) is 'email'. |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
36 | -if (! function_exists('backpack_email_column')) { |
|
36 | +if (!function_exists('backpack_email_column')) { |
|
37 | 37 | /** |
38 | 38 | * Return the email column name. |
39 | 39 | * The Laravel default (and Backpack default) is 'email'. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | -if (! function_exists('backpack_form_input')) { |
|
49 | +if (!function_exists('backpack_form_input')) { |
|
50 | 50 | /** |
51 | 51 | * Parse the submitted input in request('form') to an usable array. |
52 | 52 | * Joins the multiple[] fields in a single key and transform the dot notation fields into arrayed ones. |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | -if (! function_exists('backpack_users_have_email')) { |
|
122 | +if (!function_exists('backpack_users_have_email')) { |
|
123 | 123 | /** |
124 | 124 | * Check if the email column is present on the user table. |
125 | 125 | * |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | -if (! function_exists('backpack_avatar_url')) { |
|
137 | +if (!function_exists('backpack_avatar_url')) { |
|
138 | 138 | /** |
139 | 139 | * Returns the avatar URL of a user. |
140 | 140 | * |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | switch (config('backpack.base.avatar_type')) { |
147 | 147 | case 'gravatar': |
148 | - if (backpack_users_have_email() && ! empty($user->email)) { |
|
148 | + if (backpack_users_have_email() && !empty($user->email)) { |
|
149 | 149 | $avatarLink = Gravatar::fallback(config('backpack.base.gravatar_fallback'))->get($user->email, ['size' => 80]); |
150 | 150 | |
151 | 151 | // if we can save it locally, for safer loading, let's do it |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } |
164 | 164 | } |
165 | 165 | |
166 | -if (! function_exists('backpack_middleware')) { |
|
166 | +if (!function_exists('backpack_middleware')) { |
|
167 | 167 | /** |
168 | 168 | * Return the key of the middleware used across Backpack. |
169 | 169 | * That middleware checks if the visitor is an admin. |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | -if (! function_exists('backpack_guard_name')) { |
|
180 | +if (!function_exists('backpack_guard_name')) { |
|
181 | 181 | /* |
182 | 182 | * Returns the name of the guard defined |
183 | 183 | * by the application config |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | -if (! function_exists('backpack_auth')) { |
|
191 | +if (!function_exists('backpack_auth')) { |
|
192 | 192 | /* |
193 | 193 | * Returns the user instance if it exists |
194 | 194 | * of the currently authenticated admin |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | } |
202 | 202 | |
203 | -if (! function_exists('backpack_user')) { |
|
203 | +if (!function_exists('backpack_user')) { |
|
204 | 204 | /* |
205 | 205 | * Returns back a user instance without |
206 | 206 | * the admin guard, however allows you |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | } |
213 | 213 | } |
214 | 214 | |
215 | -if (! function_exists('mb_ucfirst')) { |
|
215 | +if (!function_exists('mb_ucfirst')) { |
|
216 | 216 | /** |
217 | 217 | * Capitalize the first letter of a string, |
218 | 218 | * even if that string is multi-byte (non-latin alphabet). |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | -if (! function_exists('backpack_view')) { |
|
236 | +if (!function_exists('backpack_view')) { |
|
237 | 237 | /** |
238 | 238 | * Returns a new displayable view path, based on the configured backpack view namespace. |
239 | 239 | * If that view doesn't exist, it falls back to the fallback namespace. |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | } |
262 | 262 | |
263 | -if (! function_exists('backpack_theme_config')) { |
|
263 | +if (!function_exists('backpack_theme_config')) { |
|
264 | 264 | /** |
265 | 265 | * Returns a config value from the current theme's config file. |
266 | 266 | * It assumes the theme's config namespace is the same as the view namespace. |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | } |
300 | 300 | } |
301 | 301 | |
302 | -if (! function_exists('square_brackets_to_dots')) { |
|
302 | +if (!function_exists('square_brackets_to_dots')) { |
|
303 | 303 | /** |
304 | 304 | * Turns a string from bracket-type array to dot-notation array. |
305 | 305 | * Ex: array[0][property] turns into array.0.property. |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | } |
316 | 316 | } |
317 | 317 | |
318 | -if (! function_exists('old_empty_or_null')) { |
|
318 | +if (!function_exists('old_empty_or_null')) { |
|
319 | 319 | /** |
320 | 320 | * This method is an alternative to Laravel's old() helper, which mistakenly |
321 | 321 | * returns NULL it two cases: |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | } |
348 | 348 | } |
349 | 349 | |
350 | -if (! function_exists('is_multidimensional_array')) { |
|
350 | +if (!function_exists('is_multidimensional_array')) { |
|
351 | 351 | /** |
352 | 352 | * If any of the items inside a given array is an array, the array is considered multidimensional. |
353 | 353 | * |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | } |
368 | 368 | |
369 | -if (! function_exists('backpack_pro')) { |
|
369 | +if (!function_exists('backpack_pro')) { |
|
370 | 370 | /** |
371 | 371 | * Check if the backpack/pro package is installed. |
372 | 372 | * |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (app()->runningUnitTests()) { |
378 | 378 | return true; |
379 | 379 | } |
380 | - if (! \Composer\InstalledVersions::isInstalled('backpack/pro')) { |
|
380 | + if (!\Composer\InstalledVersions::isInstalled('backpack/pro')) { |
|
381 | 381 | return false; |
382 | 382 | } |
383 | 383 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | (array) config('backpack.base.middleware_key', 'admin'), |
16 | 16 | 'prefix' => config('backpack.base.route_prefix', 'admin'), |
17 | 17 | ], |
18 | - function () { |
|
18 | + function() { |
|
19 | 19 | Route::crud('users', 'Backpack\CRUD\Tests\Config\Http\Controllers\UserCrudController'); |
20 | 20 | } |
21 | 21 | ); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | // Registering package commands. |
143 | - if (! empty($this->commands)) { |
|
143 | + if (!empty($this->commands)) { |
|
144 | 144 | $this->commands($this->commands); |
145 | 145 | } |
146 | 146 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | protected function packageDirectoryExistsAndIsNotEmpty($name) |
236 | 236 | { |
237 | 237 | // check if directory exists |
238 | - if (! is_dir($this->getPath().'/'.$name)) { |
|
238 | + if (!is_dir($this->getPath().'/'.$name)) { |
|
239 | 239 | return false; |
240 | 240 | } |
241 | 241 |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | // Install Backpack Generators |
85 | 85 | $this->progressBlock('Installing Generators'); |
86 | - if (! file_exists('vendor/backpack/generators/composer.json')) { |
|
86 | + if (!file_exists('vendor/backpack/generators/composer.json')) { |
|
87 | 87 | // only do this if Generators aren't already required |
88 | 88 | $process = new Process(['composer', 'require', '--dev', 'backpack/generators']); |
89 | 89 | $process->setTimeout(300); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->closeProgressBlock(); |
98 | 98 | |
99 | 99 | // Optional commands |
100 | - if (! $this->option('no-interaction')) { |
|
100 | + if (!$this->option('no-interaction')) { |
|
101 | 101 | // Themes |
102 | 102 | $this->installTheme(); |
103 | 103 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | // Addons |
108 | 108 | $this->installAddons(); |
109 | - } elseif (! $this->isAnyThemeInstalled()) { |
|
109 | + } elseif (!$this->isAnyThemeInstalled()) { |
|
110 | 110 | // Install default theme |
111 | 111 | $this->progressBlock('Installing default theme'); |
112 | 112 | $this->executeArtisanProcess('backpack:require:theme-coreuiv2'); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $this->deleteLines(3); |
189 | 189 | |
190 | - if (! $total) { |
|
190 | + if (!$total) { |
|
191 | 191 | $this->deleteLines(); |
192 | 192 | $this->note('Skipping creating an admin user.'); |
193 | 193 | $this->newLine(); |
@@ -196,14 +196,14 @@ discard block |
||
196 | 196 | |
197 | 197 | private function isEveryAddonInstalled() |
198 | 198 | { |
199 | - return collect($this->addons)->every(function ($addon) { |
|
199 | + return collect($this->addons)->every(function($addon) { |
|
200 | 200 | return file_exists($addon->path); |
201 | 201 | }); |
202 | 202 | } |
203 | 203 | |
204 | 204 | private function updateAddonsStatus() |
205 | 205 | { |
206 | - $this->addons = $this->addons->each(function (&$addon) { |
|
206 | + $this->addons = $this->addons->each(function(&$addon) { |
|
207 | 207 | $isInstalled = file_exists($addon->path); |
208 | 208 | $addon->status = $isInstalled ? 'installed' : 'not installed'; |
209 | 209 | $addon->statusColor = $isInstalled ? 'green' : 'yellow'; |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | { |
215 | 215 | // map the addons |
216 | 216 | $this->addons = collect($this->addons) |
217 | - ->map(function ($class) { |
|
217 | + ->map(function($class) { |
|
218 | 218 | return (object) $class::$addon; |
219 | 219 | }); |
220 | 220 | |
@@ -233,15 +233,15 @@ discard block |
||
233 | 233 | |
234 | 234 | // Calculate the printed line count |
235 | 235 | $printedLines = $this->addons |
236 | - ->map(function ($e) { |
|
236 | + ->map(function($e) { |
|
237 | 237 | return count($e->description); |
238 | 238 | }) |
239 | - ->reduce(function ($sum, $item) { |
|
239 | + ->reduce(function($sum, $item) { |
|
240 | 240 | return $sum + $item + 2; |
241 | 241 | }, 0); |
242 | 242 | |
243 | 243 | $total = 0; |
244 | - while (! $this->isEveryAddonInstalled()) { |
|
244 | + while (!$this->isEveryAddonInstalled()) { |
|
245 | 245 | $input = (int) $this->listChoice('Would you like to install a premium Backpack add-on? <fg=gray>(enter option number: 1, 2 or 3)</>', $this->addons->toArray()); |
246 | 246 | |
247 | 247 | if ($input < 1 || $input > $this->addons->count()) { |
@@ -276,14 +276,14 @@ discard block |
||
276 | 276 | |
277 | 277 | private function isEveryThemeInstalled() |
278 | 278 | { |
279 | - return $this->themes()->every(function ($theme) { |
|
279 | + return $this->themes()->every(function($theme) { |
|
280 | 280 | return $theme->status == 'installed'; |
281 | 281 | }); |
282 | 282 | } |
283 | 283 | |
284 | 284 | private function isAnyThemeInstalled() |
285 | 285 | { |
286 | - return $this->themes()->filter(function ($theme) { |
|
286 | + return $this->themes()->filter(function($theme) { |
|
287 | 287 | return $theme->status == 'installed'; |
288 | 288 | })->count() > 0; |
289 | 289 | } |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | |
302 | 302 | // Calculate the printed line count |
303 | 303 | $printedLines = $this->themes() |
304 | - ->map(function ($e) { |
|
304 | + ->map(function($e) { |
|
305 | 305 | return count($e->description); |
306 | 306 | }) |
307 | - ->reduce(function ($sum, $item) { |
|
307 | + ->reduce(function($sum, $item) { |
|
308 | 308 | return $sum + $item + 2; |
309 | 309 | }, 0); |
310 | 310 | |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | public function themes() |
341 | 341 | { |
342 | 342 | return collect($this->themes) |
343 | - ->map(function ($class) { |
|
343 | + ->map(function($class) { |
|
344 | 344 | return (object) $class::$addon; |
345 | - })->each(function (&$theme) { |
|
345 | + })->each(function(&$theme) { |
|
346 | 346 | $isInstalled = file_exists($theme->path); |
347 | 347 | $theme->status = $isInstalled ? 'installed' : 'not installed'; |
348 | 348 | $theme->statusColor = $isInstalled ? 'green' : 'yellow'; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $this->progressBlock("Adding menu entry to <fg=blue>$path</>"); |
50 | 50 | |
51 | 51 | // Validate file exists |
52 | - if (! $disk->exists($path)) { |
|
52 | + if (!$disk->exists($path)) { |
|
53 | 53 | $this->errorProgressBlock(); |
54 | 54 | $this->note('The menu_items file does not exist. Make sure Backpack is properly installed.', 'red'); |
55 | 55 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | - if (! $disk->put($path, $contents.PHP_EOL.$code)) { |
|
69 | + if (!$disk->put($path, $contents.PHP_EOL.$code)) { |
|
70 | 70 | $this->errorProgressBlock(); |
71 | 71 | $this->note('Could not write to menu_items file.', 'red'); |
72 | 72 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | private function getLastLineNumberThatContains($needle, $haystack) |
87 | 87 | { |
88 | - $matchingLines = array_filter($haystack, function ($k) use ($needle) { |
|
88 | + $matchingLines = array_filter($haystack, function($k) use ($needle) { |
|
89 | 89 | return strpos($k, $needle) !== false; |
90 | 90 | }); |
91 | 91 |
@@ -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 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | */ |
227 | 227 | public function subfields($subfields) |
228 | 228 | { |
229 | - $callAttributeMacro = ! isset($this->attributes['subfields']); |
|
229 | + $callAttributeMacro = !isset($this->attributes['subfields']); |
|
230 | 230 | $this->attributes['subfields'] = $subfields; |
231 | 231 | $this->attributes = $this->crud()->makeSureFieldHasNecessaryAttributes($this->attributes); |
232 | 232 | if ($callAttributeMacro) { |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | // append the field name to the rule name of validationMessages array. |
277 | 277 | // eg: ['required => 'This field is required'] |
278 | 278 | // will be transformed into: ['field_name.required' => 'This field is required] |
279 | - $this->crud()->setValidationFromArray([], array_merge(...array_map(function ($rule, $message) { |
|
279 | + $this->crud()->setValidationFromArray([], array_merge(...array_map(function($rule, $message) { |
|
280 | 280 | return [$this->attributes['name'].'.'.$rule => $message]; |
281 | 281 | }, array_keys($messages), $messages))); |
282 | 282 |