We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | { |
| 9 | 9 | public array $hooks = []; |
| 10 | 10 | |
| 11 | - public function hookInto(string|array $hooks, callable $callback): void |
|
| 11 | + public function hookInto(string | array $hooks, callable $callback): void |
|
| 12 | 12 | { |
| 13 | 13 | $hooks = is_array($hooks) ? $hooks : [$hooks]; |
| 14 | 14 | $controller = CrudManager::getActiveController() ?? CrudManager::getParentController(); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - public function trigger(string|array $hooks, array $parameters = []): void |
|
| 20 | + public function trigger(string | array $hooks, array $parameters = []): void |
|
| 21 | 21 | { |
| 22 | 22 | $hooks = is_array($hooks) ? $hooks : [$hooks]; |
| 23 | 23 | $controller = CrudManager::getActiveController() ?? CrudManager::getParentController(); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function cacheForComponent(string $tableId, string $controllerClass, ?\Closure $setup = null, ?string $name = null, ?CrudPanel $crud = null): bool |
| 28 | 28 | { |
| 29 | - if (! $setup) { |
|
| 29 | + if (!$setup) { |
|
| 30 | 30 | return false; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | // Check if the request has a datatable_id parameter |
| 88 | 88 | $tableId = request('datatable_id'); |
| 89 | 89 | |
| 90 | - if (! $tableId) { |
|
| 90 | + if (!$tableId) { |
|
| 91 | 91 | \Log::debug('Missing datatable_id in request parameters'); |
| 92 | 92 | |
| 93 | 93 | return false; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | public function applySetupClosure(CrudPanel $crud, string $controllerClass, \Closure $setupClosure, $entry = null): bool |
| 109 | 109 | { |
| 110 | 110 | $originalSetup = $setupClosure; |
| 111 | - $modifiedSetup = function ($crud, $entry) use ($originalSetup, $controllerClass) { |
|
| 111 | + $modifiedSetup = function($crud, $entry) use ($originalSetup, $controllerClass) { |
|
| 112 | 112 | CrudManager::setActiveController($controllerClass); |
| 113 | 113 | |
| 114 | 114 | // Run the original closure |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $cacheKey = $this->generateCacheKey($identifier); |
| 44 | 44 | $cachedData = Cache::get($cacheKey); |
| 45 | 45 | |
| 46 | - if (! $cachedData) { |
|
| 46 | + if (!$cachedData) { |
|
| 47 | 47 | return false; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | ); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if (! $this->crud->has('list.datatablesUrl')) { |
|
| 40 | + if (!$this->crud->has('list.datatablesUrl')) { |
|
| 41 | 41 | $this->crud->set('list.datatablesUrl', $this->crud->getRoute()); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -85,32 +85,32 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $this->registerBackpackErrorViews(); |
| 87 | 87 | |
| 88 | - $this->app->bind('crud', function ($app) { |
|
| 88 | + $this->app->bind('crud', function($app) { |
|
| 89 | 89 | return CrudManager::identifyCrudPanel(); |
| 90 | 90 | }); |
| 91 | 91 | |
| 92 | - $this->app->scoped('CrudManager', function ($app) { |
|
| 92 | + $this->app->scoped('CrudManager', function($app) { |
|
| 93 | 93 | return new CrudPanelManager(); |
| 94 | 94 | }); |
| 95 | 95 | |
| 96 | - $this->app->scoped('DatabaseSchema', function ($app) { |
|
| 96 | + $this->app->scoped('DatabaseSchema', function($app) { |
|
| 97 | 97 | return new DatabaseSchema(); |
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | - $this->app->scoped('BackpackLifecycleHooks', function ($app) { |
|
| 100 | + $this->app->scoped('BackpackLifecycleHooks', function($app) { |
|
| 101 | 101 | return new app\Library\CrudPanel\Hooks\LifecycleHooks(); |
| 102 | 102 | }); |
| 103 | 103 | |
| 104 | - $this->app->singleton('BackpackViewNamespaces', function ($app) { |
|
| 104 | + $this->app->singleton('BackpackViewNamespaces', function($app) { |
|
| 105 | 105 | return new ViewNamespaces(); |
| 106 | 106 | }); |
| 107 | 107 | |
| 108 | 108 | // Bind the widgets collection object to Laravel's service container |
| 109 | - $this->app->singleton('widgets', function ($app) { |
|
| 109 | + $this->app->singleton('widgets', function($app) { |
|
| 110 | 110 | return new Collection(); |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | - $this->app->scoped('UploadersRepository', function ($app) { |
|
| 113 | + $this->app->scoped('UploadersRepository', function($app) { |
|
| 114 | 114 | return new UploadersRepository(); |
| 115 | 115 | }); |
| 116 | 116 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $middleware_key = config('backpack.base.middleware_key'); |
| 127 | 127 | $middleware_class = config('backpack.base.middleware_class'); |
| 128 | 128 | |
| 129 | - if (! is_array($middleware_class)) { |
|
| 129 | + if (!is_array($middleware_class)) { |
|
| 130 | 130 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
| 131 | 131 | |
| 132 | 132 | return; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | $configs = scandir(__DIR__."/config/backpack/$dir/"); |
| 242 | 242 | $configs = array_diff($configs, ['.', '..']); |
| 243 | 243 | |
| 244 | - if (! count($configs)) { |
|
| 244 | + if (!count($configs)) { |
|
| 245 | 245 | return; |
| 246 | 246 | } |
| 247 | 247 | |
@@ -290,8 +290,7 @@ discard block |
||
| 290 | 290 | // add the backpack_users password broker to the configuration |
| 291 | 291 | $laravelAuthPasswordBrokers = app()->config['auth.passwords']; |
| 292 | 292 | $laravelFirstPasswordBroker = is_array($laravelAuthPasswordBrokers) && current($laravelAuthPasswordBrokers) ? |
| 293 | - current($laravelAuthPasswordBrokers)['table'] : |
|
| 294 | - ''; |
|
| 293 | + current($laravelAuthPasswordBrokers)['table'] : ''; |
|
| 295 | 294 | |
| 296 | 295 | $backpackPasswordBrokerTable = config('backpack.base.password_resets_table') ?? |
| 297 | 296 | config('auth.passwords.users.table') ?? |
@@ -319,7 +318,7 @@ discard block |
||
| 319 | 318 | |
| 320 | 319 | public function loadViewComponents() |
| 321 | 320 | { |
| 322 | - $this->app->afterResolving(BladeCompiler::class, function () { |
|
| 321 | + $this->app->afterResolving(BladeCompiler::class, function() { |
|
| 323 | 322 | Blade::componentNamespace('Backpack\\CRUD\\app\\View\\Components', 'backpack'); |
| 324 | 323 | }); |
| 325 | 324 | } |
@@ -335,7 +334,7 @@ discard block |
||
| 335 | 334 | $path = __DIR__.'/app/View/Components'; |
| 336 | 335 | $namespace = 'Backpack\\CRUD\\app\\View\\Components'; |
| 337 | 336 | |
| 338 | - if (! is_dir($path)) { |
|
| 337 | + if (!is_dir($path)) { |
|
| 339 | 338 | return; |
| 340 | 339 | } |
| 341 | 340 | |
@@ -377,13 +376,13 @@ discard block |
||
| 377 | 376 | private function registerBackpackErrorViews() |
| 378 | 377 | { |
| 379 | 378 | // register the backpack error when the exception handler is resolved from the container |
| 380 | - $this->callAfterResolving(ExceptionHandler::class, function ($handler) { |
|
| 381 | - if (! Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
| 379 | + $this->callAfterResolving(ExceptionHandler::class, function($handler) { |
|
| 380 | + if (!Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
| 382 | 381 | return; |
| 383 | 382 | } |
| 384 | 383 | |
| 385 | 384 | // parse the namespaces set in config |
| 386 | - [$themeNamespace, $themeFallbackNamespace] = (function () { |
|
| 385 | + [$themeNamespace, $themeFallbackNamespace] = (function() { |
|
| 387 | 386 | $themeNamespace = config('backpack.ui.view_namespace'); |
| 388 | 387 | $themeFallbackNamespace = config('backpack.ui.view_namespace_fallback'); |
| 389 | 388 | |
@@ -400,8 +399,7 @@ discard block |
||
| 400 | 399 | // - fallback theme paths |
| 401 | 400 | // - ui path |
| 402 | 401 | $themeErrorPaths = $viewFinderHints[$themeNamespace] ?? []; |
| 403 | - $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : |
|
| 404 | - array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
| 402 | + $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
| 405 | 403 | $uiErrorPaths = [base_path('vendor/backpack/crud/src/resources/views/ui')]; |
| 406 | 404 | $themeErrorPaths = array_merge($themeErrorPaths, $uiErrorPaths); |
| 407 | 405 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | public static function addFor(string $domain, $viewNamespaces) |
| 30 | 30 | { |
| 31 | 31 | foreach ((array) $viewNamespaces as $viewNamespace) { |
| 32 | - if (! in_array($viewNamespace, self::getForDomain($domain))) { |
|
| 32 | + if (!in_array($viewNamespace, self::getForDomain($domain))) { |
|
| 33 | 33 | self::$viewNamespaces[$domain][] = $viewNamespace; |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | public static function getViewPathsFor(string $domain, string $viewName) |
| 87 | 87 | { |
| 88 | - return array_map(function ($item) use ($viewName) { |
|
| 88 | + return array_map(function($item) use ($viewName) { |
|
| 89 | 89 | return $item.'.'.$viewName; |
| 90 | 90 | }, self::getFor($domain)); |
| 91 | 91 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $paths = self::getViewPathsFor($domain, $viewName); |
| 105 | 105 | |
| 106 | 106 | // Add fallback if provided and not already in the list |
| 107 | - if ($fallbackViewPath && ! in_array($fallbackViewPath, $paths)) { |
|
| 107 | + if ($fallbackViewPath && !in_array($fallbackViewPath, $paths)) { |
|
| 108 | 108 | $paths[] = $fallbackViewPath; |
| 109 | 109 | } |
| 110 | 110 | |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public ?string $operation = 'show', |
| 20 | 20 | public ?\Closure $setup = null, |
| 21 | 21 | public ?CrudPanel $crud = null, |
| 22 | - public array|Collection $columns = [], |
|
| 22 | + public array | Collection $columns = [], |
|
| 23 | 23 | public bool $displayButtons = true |
| 24 | 24 | ) { |
| 25 | 25 | $this->setPropertiesFromController(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | protected function setPropertiesFromController(): void |
| 35 | 35 | { |
| 36 | 36 | // If no CrudController is provided, do nothing |
| 37 | - if (! $this->controller) { |
|
| 37 | + if (!$this->controller) { |
|
| 38 | 38 | return; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | // If a setup closure is provided, apply it |
| 48 | 48 | if ($this->setup) { |
| 49 | - if (! empty($columns)) { |
|
| 49 | + if (!empty($columns)) { |
|
| 50 | 50 | throw new \Exception('You cannot define both setup closure and columns for a '.class_basename(static::class).' component.'); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | ($this->setup)($this->crud, $this->entry); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $this->columns = ! empty($columns) ? $columns : $this->crud?->getOperationSetting('columns', $this->operation) ?? []; |
|
| 56 | + $this->columns = !empty($columns) ? $columns : $this->crud?->getOperationSetting('columns', $this->operation) ?? []; |
|
| 57 | 57 | |
| 58 | 58 | // Reset the active controller |
| 59 | 59 | CrudManager::unsetActiveController(); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * Get or create a CrudPanel instance for the given controller. |
| 36 | 36 | */ |
| 37 | - public function getCrudPanel(CrudControllerContract|string $controller): CrudPanel |
|
| 37 | + public function getCrudPanel(CrudControllerContract | string $controller): CrudPanel |
|
| 38 | 38 | { |
| 39 | 39 | $controllerClass = is_string($controller) ? $controller : get_class($controller); |
| 40 | 40 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $crud->setOperation($operation); |
| 70 | 70 | |
| 71 | 71 | $primaryControllerRequest = $this->cruds[array_key_first($this->cruds)]->getRequest(); |
| 72 | - if (! $crud->isInitialized() || ! $this->isOperationInitialized($controller::class, $operation)) { |
|
| 72 | + if (!$crud->isInitialized() || !$this->isOperationInitialized($controller::class, $operation)) { |
|
| 73 | 73 | self::setActiveController($controller::class); |
| 74 | 74 | $crud->initialized = false; |
| 75 | 75 | self::setActiveController($controller::class); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function storeInitializedOperation(string $controller, ?string $operation): void |
| 101 | 101 | { |
| 102 | - if (! $operation) { |
|
| 102 | + if (!$operation) { |
|
| 103 | 103 | return; |
| 104 | 104 | } |
| 105 | 105 | $this->initializedOperations[$controller][] = $operation; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public function getActiveCrudPanel(string $controller): CrudPanel |
| 142 | 142 | { |
| 143 | - if (! isset($this->cruds[$controller])) { |
|
| 143 | + if (!isset($this->cruds[$controller])) { |
|
| 144 | 144 | return $this->getCrudPanel($this->getActiveController() ?? $this->getParentController() ?? $controller); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | public function getParentController(): ?string |
| 156 | 156 | { |
| 157 | - if (! empty($this->cruds)) { |
|
| 157 | + if (!empty($this->cruds)) { |
|
| 158 | 158 | return array_key_first($this->cruds); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | $cruds = $this->getCrudPanels(); |
| 229 | 229 | |
| 230 | - if (! empty($cruds)) { |
|
| 230 | + if (!empty($cruds)) { |
|
| 231 | 231 | $crudPanel = reset($cruds); |
| 232 | 232 | |
| 233 | 233 | return $crudPanel; |