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 | $otherButtons = collect([]); |
25 | 25 | |
26 | 26 | // we get the buttons that belong to the specified stack |
27 | - $stackButtons = $this->buttons()->reject(function ($item) use ($stack, $otherButtons) { |
|
27 | + $stackButtons = $this->buttons()->reject(function($item) use ($stack, $otherButtons) { |
|
28 | 28 | if ($item->stack != $stack) { |
29 | 29 | // if the button does not belong to this stack we just add it for merging later |
30 | 30 | $otherButtons->push($item); |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | }); |
37 | 37 | |
38 | 38 | // we parse the ordered buttons |
39 | - collect($order)->each(function ($btnKey) use ($newButtons, $stackButtons) { |
|
40 | - if (! $button = $stackButtons->where('name', $btnKey)->first()) { |
|
39 | + collect($order)->each(function($btnKey) use ($newButtons, $stackButtons) { |
|
40 | + if (!$button = $stackButtons->where('name', $btnKey)->first()) { |
|
41 | 41 | abort(500, 'Button name [«'.$btnKey.'»] not found.', ['developer-error-exception']); |
42 | 42 | } |
43 | 43 | $newButtons->push($button); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | // we add the remaining buttons to the end of the ordered ones |
48 | 48 | if (count($newButtons) < count($stackButtons)) { |
49 | 49 | foreach ($stackButtons as $button) { |
50 | - if (! $newButtons->where('name', $button->name)->first()) { |
|
50 | + if (!$newButtons->where('name', $button->name)->first()) { |
|
51 | 51 | $newButtons->push($button); |
52 | 52 | } |
53 | 53 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | $button = $this->buttons()->firstWhere('name', $name); |
118 | 118 | |
119 | - if (! $button) { |
|
119 | + if (!$button) { |
|
120 | 120 | abort(500, 'CRUD Button "'.$name.'" not found. Please ensure the button exists before you modify it.', ['developer-error-exception']); |
121 | 121 | } |
122 | 122 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public function removeButton($name, $stack = null) |
139 | 139 | { |
140 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
140 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
141 | 141 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
142 | 142 | })); |
143 | 143 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function removeButtons($names, $stack = null) |
150 | 150 | { |
151 | - if (! empty($names)) { |
|
151 | + if (!empty($names)) { |
|
152 | 152 | foreach ($names as $name) { |
153 | 153 | $this->removeButton($name, $stack); |
154 | 154 | } |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | |
163 | 163 | public function removeAllButtonsFromStack($stack) |
164 | 164 | { |
165 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
|
165 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($stack) { |
|
166 | 166 | return $button->stack == $stack; |
167 | 167 | })); |
168 | 168 | } |
169 | 169 | |
170 | 170 | public function removeButtonFromStack($name, $stack) |
171 | 171 | { |
172 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
172 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
173 | 173 | return $button->name == $name && $button->stack == $stack; |
174 | 174 | })); |
175 | 175 | } |
@@ -190,15 +190,15 @@ discard block |
||
190 | 190 | $destinationKey = $this->getButtonKey($destination); |
191 | 191 | $newDestinationKey = ($where == 'before' ? $destinationKey : $destinationKey + 1); |
192 | 192 | |
193 | - $newButtons = $this->buttons()->filter(function ($value, $key) use ($target) { |
|
193 | + $newButtons = $this->buttons()->filter(function($value, $key) use ($target) { |
|
194 | 194 | return $value->name != $target; |
195 | 195 | }); |
196 | 196 | |
197 | - if (! $targetButton) { |
|
197 | + if (!$targetButton) { |
|
198 | 198 | return; |
199 | 199 | } |
200 | 200 | |
201 | - if (! $destinationButton) { |
|
201 | + if (!$destinationButton) { |
|
202 | 202 | return; |
203 | 203 | } |
204 | 204 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | |
208 | 208 | $newButtons = $firstSlice->push($targetButton); |
209 | 209 | |
210 | - $lastSlice->each(function ($item, $key) use ($newButtons) { |
|
210 | + $lastSlice->each(function($item, $key) use ($newButtons) { |
|
211 | 211 | $newButtons->push($item); |
212 | 212 | }); |
213 | 213 | |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | /** |
267 | 267 | * Add a new button to the current CRUD operation. |
268 | 268 | */ |
269 | - public function button(string|array $nameOrAttributes): CrudButton |
|
269 | + public function button(string | array $nameOrAttributes): CrudButton |
|
270 | 270 | { |
271 | 271 | return new CrudButton($nameOrAttributes); |
272 | 272 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function key(string $key) |
89 | 89 | { |
90 | - if (! isset($this->attributes['name'])) { |
|
90 | + if (!isset($this->attributes['name'])) { |
|
91 | 91 | abort(500, 'Column name must be defined before changing the key.', ['developer-error-exception']); |
92 | 92 | } |
93 | 93 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function subfields($subfields) |
181 | 181 | { |
182 | - $callAttributeMacro = ! isset($this->attributes['subfields']); |
|
182 | + $callAttributeMacro = !isset($this->attributes['subfields']); |
|
183 | 183 | $this->attributes['subfields'] = $subfields; |
184 | 184 | $this->attributes = $this->crud()->makeSureColumnHasNeededAttributes($this->attributes); |
185 | 185 | if ($callAttributeMacro) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // |
40 | 40 | // It's done inside a middleware closure in order to have |
41 | 41 | // the complete request inside the CrudPanel object. |
42 | - $this->middleware(function ($request, $next) { |
|
42 | + $this->middleware(function($request, $next) { |
|
43 | 43 | $this->crud = app('crud'); |
44 | 44 | |
45 | 45 | $this->crud->setRequest($request); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | protected function setupConfigurationForCurrentOperation() |
111 | 111 | { |
112 | 112 | $operationName = $this->crud->getCurrentOperation(); |
113 | - if (! $operationName) { |
|
113 | + if (!$operationName) { |
|
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | * you'd like the defaults to be applied before anything you write. That way, anything you |
127 | 127 | * write is done after the default, so you can remove default settings, etc; |
128 | 128 | */ |
129 | - if (! OperationHook::has(OperationHooks::SETUP_OPERATION_FROM_CONFIG, $operationName)) { |
|
130 | - OperationHook::register(OperationHooks::SETUP_OPERATION_FROM_CONFIG, $operationName, function () use ($operationName) { |
|
129 | + if (!OperationHook::has(OperationHooks::SETUP_OPERATION_FROM_CONFIG, $operationName)) { |
|
130 | + OperationHook::register(OperationHooks::SETUP_OPERATION_FROM_CONFIG, $operationName, function() use ($operationName) { |
|
131 | 131 | return 'backpack.operations.'.$operationName; |
132 | 132 | }); |
133 | 133 | } |
@@ -40,24 +40,24 @@ |
||
40 | 40 | // Access |
41 | 41 | $this->crud->allowAccess($operationName); |
42 | 42 | |
43 | - OperationHook::register(OperationHooks::SETUP_OPERATION_FROM_CONFIG, $operationName, function () use ($operationName) { |
|
43 | + OperationHook::register(OperationHooks::SETUP_OPERATION_FROM_CONFIG, $operationName, function() use ($operationName) { |
|
44 | 44 | return config()->has('backpack.operations.'.$operationName) ? 'backpack.operations.'.$operationName : 'backpack.operations.form'; |
45 | 45 | }); |
46 | 46 | |
47 | - OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, $operationName, function () use ($operationName) { |
|
47 | + OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, $operationName, function() use ($operationName) { |
|
48 | 48 | $this->crud->addSaveAction([ |
49 | 49 | 'name' => 'save_and_back', |
50 | - 'visible' => function ($crud) use ($operationName) { |
|
50 | + 'visible' => function($crud) use ($operationName) { |
|
51 | 51 | return $crud->hasAccess($operationName); |
52 | 52 | }, |
53 | - 'redirect' => function ($crud, $request, $itemId = null) { |
|
53 | + 'redirect' => function($crud, $request, $itemId = null) { |
|
54 | 54 | return $request->request->has('_http_referrer') ? $request->request->get('_http_referrer') : $crud->route; |
55 | 55 | }, |
56 | 56 | 'button_text' => trans('backpack::crud.save_action_save_and_back'), |
57 | 57 | ]); |
58 | 58 | }); |
59 | 59 | |
60 | - OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, ['list', 'show'], function () use ($operationName, $buttonStack, $buttonMeta) { |
|
60 | + OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, ['list', 'show'], function() use ($operationName, $buttonStack, $buttonMeta) { |
|
61 | 61 | $this->crud->button($operationName)->view('crud::buttons.quick')->stack($buttonStack)->meta($buttonMeta); |
62 | 62 | }); |
63 | 63 | } |
@@ -37,11 +37,11 @@ |
||
37 | 37 | { |
38 | 38 | $this->crud->allowAccess('create'); |
39 | 39 | |
40 | - OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, 'create', function () { |
|
40 | + OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, 'create', function() { |
|
41 | 41 | $this->crud->setupDefaultSaveActions(); |
42 | 42 | }); |
43 | 43 | |
44 | - OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, 'list', function () { |
|
44 | + OperationHook::register(OperationHooks::BEFORE_OPERATION_SETUP, 'list', function() { |
|
45 | 45 | $this->crud->addButton('top', 'create', 'view', 'crud::buttons.create'); |
46 | 46 | }); |
47 | 47 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | public array $hooks = []; |
12 | 12 | |
13 | - public function register(string $hook, string|array $operations, callable $callback): void |
|
13 | + public function register(string $hook, string | array $operations, callable $callback): void |
|
14 | 14 | { |
15 | 15 | $operations = is_array($operations) ? $operations : [$operations]; |
16 | 16 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | } |
20 | 20 | } |
21 | 21 | |
22 | - public function run(string $hook, string|array $operations, array $parameters): void |
|
22 | + public function run(string $hook, string | array $operations, array $parameters): void |
|
23 | 23 | { |
24 | 24 | $operations = is_array($operations) ? $operations : [$operations]; |
25 | 25 | foreach ($operations as $operation) { |
@@ -83,32 +83,32 @@ discard block |
||
83 | 83 | $this->registerBackpackErrorViews(); |
84 | 84 | |
85 | 85 | // Bind the CrudPanel object to Laravel's service container |
86 | - $this->app->scoped('crud', function ($app) { |
|
86 | + $this->app->scoped('crud', function($app) { |
|
87 | 87 | return new CrudPanel(); |
88 | 88 | }); |
89 | 89 | |
90 | - $this->app->scoped('DatabaseSchema', function ($app) { |
|
90 | + $this->app->scoped('DatabaseSchema', function($app) { |
|
91 | 91 | return new DatabaseSchema(); |
92 | 92 | }); |
93 | 93 | |
94 | - $this->app->scoped('operation-hook', function ($app) { |
|
94 | + $this->app->scoped('operation-hook', function($app) { |
|
95 | 95 | return new \Backpack\CRUD\app\Library\CrudPanel\Hooks\OperationHooks(); |
96 | 96 | }); |
97 | 97 | |
98 | - $this->app->scoped('panel-hook', function ($app) { |
|
98 | + $this->app->scoped('panel-hook', function($app) { |
|
99 | 99 | return new \Backpack\CRUD\app\Library\CrudPanel\Hooks\PanelHooks(); |
100 | 100 | }); |
101 | 101 | |
102 | - $this->app->singleton('BackpackViewNamespaces', function ($app) { |
|
102 | + $this->app->singleton('BackpackViewNamespaces', function($app) { |
|
103 | 103 | return new ViewNamespaces(); |
104 | 104 | }); |
105 | 105 | |
106 | 106 | // Bind the widgets collection object to Laravel's service container |
107 | - $this->app->singleton('widgets', function ($app) { |
|
107 | + $this->app->singleton('widgets', function($app) { |
|
108 | 108 | return new Collection(); |
109 | 109 | }); |
110 | 110 | |
111 | - $this->app->scoped('UploadersRepository', function ($app) { |
|
111 | + $this->app->scoped('UploadersRepository', function($app) { |
|
112 | 112 | return new UploadersRepository(); |
113 | 113 | }); |
114 | 114 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $middleware_key = config('backpack.base.middleware_key'); |
125 | 125 | $middleware_class = config('backpack.base.middleware_class'); |
126 | 126 | |
127 | - if (! is_array($middleware_class)) { |
|
127 | + if (!is_array($middleware_class)) { |
|
128 | 128 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
129 | 129 | |
130 | 130 | return; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $configs = scandir(__DIR__."/config/backpack/$dir/"); |
240 | 240 | $configs = array_diff($configs, ['.', '..']); |
241 | 241 | |
242 | - if (! count($configs)) { |
|
242 | + if (!count($configs)) { |
|
243 | 243 | return; |
244 | 244 | } |
245 | 245 | |
@@ -288,8 +288,7 @@ discard block |
||
288 | 288 | // add the backpack_users password broker to the configuration |
289 | 289 | $laravelAuthPasswordBrokers = app()->config['auth.passwords']; |
290 | 290 | $laravelFirstPasswordBroker = is_array($laravelAuthPasswordBrokers) && current($laravelAuthPasswordBrokers) ? |
291 | - current($laravelAuthPasswordBrokers)['table'] : |
|
292 | - ''; |
|
291 | + current($laravelAuthPasswordBrokers)['table'] : ''; |
|
293 | 292 | |
294 | 293 | $backpackPasswordBrokerTable = config('backpack.base.password_resets_table') ?? |
295 | 294 | config('auth.passwords.users.table') ?? |
@@ -317,7 +316,7 @@ discard block |
||
317 | 316 | |
318 | 317 | public function loadViewComponents() |
319 | 318 | { |
320 | - $this->app->afterResolving(BladeCompiler::class, function () { |
|
319 | + $this->app->afterResolving(BladeCompiler::class, function() { |
|
321 | 320 | Blade::componentNamespace('Backpack\\CRUD\\app\\View\\Components', 'backpack'); |
322 | 321 | }); |
323 | 322 | } |
@@ -343,13 +342,13 @@ discard block |
||
343 | 342 | private function registerBackpackErrorViews() |
344 | 343 | { |
345 | 344 | // register the backpack error when the exception handler is resolved from the container |
346 | - $this->callAfterResolving(ExceptionHandler::class, function ($handler) { |
|
347 | - if (! Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
345 | + $this->callAfterResolving(ExceptionHandler::class, function($handler) { |
|
346 | + if (!Str::startsWith(request()->path(), config('backpack.base.route_prefix'))) { |
|
348 | 347 | return; |
349 | 348 | } |
350 | 349 | |
351 | 350 | // parse the namespaces set in config |
352 | - [$themeNamespace, $themeFallbackNamespace] = (function () { |
|
351 | + [$themeNamespace, $themeFallbackNamespace] = (function() { |
|
353 | 352 | $themeNamespace = config('backpack.ui.view_namespace'); |
354 | 353 | $themeFallbackNamespace = config('backpack.ui.view_namespace_fallback'); |
355 | 354 | |
@@ -366,8 +365,7 @@ discard block |
||
366 | 365 | // - fallback theme paths |
367 | 366 | // - ui path |
368 | 367 | $themeErrorPaths = $viewFinderHints[$themeNamespace] ?? []; |
369 | - $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : |
|
370 | - array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
368 | + $themeErrorPaths = $themeNamespace === $themeFallbackNamespace ? $themeErrorPaths : array_merge($viewFinderHints[$themeFallbackNamespace] ?? [], $themeErrorPaths); |
|
371 | 369 | $uiErrorPaths = [base_path('vendor/backpack/crud/src/resources/views/ui')]; |
372 | 370 | $themeErrorPaths = array_merge($themeErrorPaths, $uiErrorPaths); |
373 | 371 |