We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | // |
| 33 | 33 | // It's done inside a middleware closure in order to have |
| 34 | 34 | // the complete request inside the CrudPanel object. |
| 35 | - $this->middleware(function ($request, $next) { |
|
| 35 | + $this->middleware(function($request, $next) { |
|
| 36 | 36 | $this->crud = app('crud'); |
| 37 | 37 | |
| 38 | 38 | $this->crud->setRequest($request); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | protected function setupConfigurationForCurrentOperation() |
| 97 | 97 | { |
| 98 | 98 | $operationName = $this->crud->getCurrentOperation(); |
| 99 | - if (! $operationName) { |
|
| 99 | + if (!$operationName) { |
|
| 100 | 100 | return; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -124,9 +124,9 @@ |
||
| 124 | 124 | * you'd like the defaults to be applied before anything you write. That way, anything you |
| 125 | 125 | * write is done after the default, so you can remove default settings, etc; |
| 126 | 126 | */ |
| 127 | - LifecycleHook::trigger($operationName.':before_setup', [$this]); |
|
| 127 | + LifecycleHook::trigger($operationName.':before_setup', [$this]); |
|
| 128 | 128 | |
| 129 | - $this->crud->applyConfigurationFromSettings($operationName); |
|
| 129 | + $this->crud->applyConfigurationFromSettings($operationName); |
|
| 130 | 130 | |
| 131 | 131 | /* |
| 132 | 132 | * THEN, run the corresponding setupXxxOperation if it exists. |
@@ -51,17 +51,17 @@ |
||
| 51 | 51 | // add a reasonable "save and back" save action |
| 52 | 52 | $this->crud->addSaveAction([ |
| 53 | 53 | 'name' => 'save_and_back', |
| 54 | - 'visible' => function ($crud) use ($operationName) { |
|
| 54 | + 'visible' => function($crud) use ($operationName) { |
|
| 55 | 55 | return $crud->hasAccess($operationName); |
| 56 | 56 | }, |
| 57 | - 'redirect' => function ($crud, $request, $itemId = null) { |
|
| 57 | + 'redirect' => function($crud, $request, $itemId = null) { |
|
| 58 | 58 | return $request->request->has('_http_referrer') ? $request->request->get('_http_referrer') : $crud->route; |
| 59 | 59 | }, |
| 60 | 60 | 'button_text' => trans('backpack::crud.save_action_save_and_back'), |
| 61 | 61 | ]); |
| 62 | 62 | }); |
| 63 | 63 | |
| 64 | - LifecycleHook::hookInto(['list:before_setup', 'show:before_setup'], function () use ($operationName, $buttonStack, $buttonMeta) { |
|
| 64 | + LifecycleHook::hookInto(['list:before_setup', 'show:before_setup'], function() use ($operationName, $buttonStack, $buttonMeta) { |
|
| 65 | 65 | $this->crud->button($operationName)->view('crud::buttons.quick')->stack($buttonStack)->meta($buttonMeta); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -31,25 +31,25 @@ |
||
| 31 | 31 | $this->crud->allowAccess('show'); |
| 32 | 32 | $this->crud->setOperationSetting('setFromDb', true); |
| 33 | 33 | |
| 34 | - LifecycleHook::hookInto('show:before_setup', function () { |
|
| 34 | + LifecycleHook::hookInto('show:before_setup', function() { |
|
| 35 | 35 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
| 36 | 36 | |
| 37 | - if (! method_exists($this, 'setupShowOperation')) { |
|
| 37 | + if (!method_exists($this, 'setupShowOperation')) { |
|
| 38 | 38 | $this->autoSetupShowOperation(); |
| 39 | 39 | } |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | - LifecycleHook::hookInto(['list:before_setup'], function () { |
|
| 42 | + LifecycleHook::hookInto(['list:before_setup'], function() { |
|
| 43 | 43 | $this->crud->addButton('line', 'show', 'view', 'crud::buttons.show', 'beginning'); |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - LifecycleHook::hookInto(['create:before_setup', 'update:before_setup'], function () { |
|
| 46 | + LifecycleHook::hookInto(['create:before_setup', 'update:before_setup'], function() { |
|
| 47 | 47 | $this->crud->addSaveAction([ |
| 48 | 48 | 'name' => 'save_and_preview', |
| 49 | - 'visible' => function ($crud) { |
|
| 49 | + 'visible' => function($crud) { |
|
| 50 | 50 | return $crud->hasAccess('show'); |
| 51 | 51 | }, |
| 52 | - 'redirect' => function ($crud, $request, $itemId = null) { |
|
| 52 | + 'redirect' => function($crud, $request, $itemId = null) { |
|
| 53 | 53 | $itemId = $itemId ?: $request->input('id'); |
| 54 | 54 | $redirectUrl = $crud->route.'/'.$itemId.'/show'; |
| 55 | 55 | if ($request->has('_locale')) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $this->crud->allowAccess('update'); |
| 38 | 38 | |
| 39 | - LifecycleHook::hookInto('update:before_setup', function () { |
|
| 39 | + LifecycleHook::hookInto('update:before_setup', function() { |
|
| 40 | 40 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
| 41 | 41 | |
| 42 | 42 | if ($this->crud->getModel()->translationEnabled()) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $this->crud->setupDefaultSaveActions(); |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | - LifecycleHook::hookInto(['list:before_setup', 'show:before_setup'], function () { |
|
| 53 | + LifecycleHook::hookInto(['list:before_setup', 'show:before_setup'], function() { |
|
| 54 | 54 | $this->crud->addButton('line', 'update', 'view', 'crud::buttons.update', 'end'); |
| 55 | 55 | }); |
| 56 | 56 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $this->crud->set('reorder.enabled', true); |
| 38 | 38 | $this->crud->allowAccess('reorder'); |
| 39 | 39 | |
| 40 | - LifecycleHook::hookInto('reorder:before_setup', function () { |
|
| 40 | + LifecycleHook::hookInto('reorder:before_setup', function() { |
|
| 41 | 41 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
| 42 | 42 | $this->crud->setOperationSetting('reorderColumnNames', [ |
| 43 | 43 | 'parent_id' => 'parent_id', |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ]); |
| 48 | 48 | }); |
| 49 | 49 | |
| 50 | - LifecycleHook::hookInto('list:before_setup', function () { |
|
| 50 | + LifecycleHook::hookInto('list:before_setup', function() { |
|
| 51 | 51 | $this->crud->addButton('top', 'reorder', 'view', 'crud::buttons.reorder'); |
| 52 | 52 | }); |
| 53 | 53 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $this->crud->hasAccessOrFail('reorder'); |
| 65 | 65 | |
| 66 | - if (! $this->crud->isReorderEnabled()) { |
|
| 66 | + if (!$this->crud->isReorderEnabled()) { |
|
| 67 | 67 | abort(403, 'Reorder is disabled.'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | 'operation' => 'list', |
| 29 | 29 | ]); |
| 30 | 30 | |
| 31 | - if (! isset($this->setupDetailsRowRoute) || $this->setupDetailsRowRoute === true) { |
|
| 31 | + if (!isset($this->setupDetailsRowRoute) || $this->setupDetailsRowRoute === true) { |
|
| 32 | 32 | Route::get($segment.'/{id}/details', [ |
| 33 | 33 | 'as' => $routeName.'.showDetailsRow', |
| 34 | 34 | 'uses' => $controller.'@showDetailsRow', |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | { |
| 45 | 45 | $this->crud->allowAccess('list'); |
| 46 | 46 | |
| 47 | - LifecycleHook::hookInto('list:before_setup', function () { |
|
| 47 | + LifecycleHook::hookInto('list:before_setup', function() { |
|
| 48 | 48 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
| 49 | 49 | }); |
| 50 | 50 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $search = request()->input('search'); |
| 82 | 82 | |
| 83 | 83 | // check if length is allowed by developer |
| 84 | - if ($length && ! in_array($length, $this->crud->getPageLengthMenu()[0])) { |
|
| 84 | + if ($length && !in_array($length, $this->crud->getPageLengthMenu()[0])) { |
|
| 85 | 85 | return response()->json([ |
| 86 | 86 | 'error' => 'Unknown page length.', |
| 87 | 87 | ], 400); |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | public array $hooks = []; |
| 8 | 8 | |
| 9 | - public function hookInto(string|array $hooks, callable $callback): void |
|
| 9 | + public function hookInto(string | array $hooks, callable $callback): void |
|
| 10 | 10 | { |
| 11 | 11 | $hooks = is_array($hooks) ? $hooks : [$hooks]; |
| 12 | 12 | foreach ($hooks as $hook) { |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - public function trigger(string|array $hooks, array $parameters): void |
|
| 17 | + public function trigger(string | array $hooks, array $parameters): void |
|
| 18 | 18 | { |
| 19 | 19 | $hooks = is_array($hooks) ? $hooks : [$hooks]; |
| 20 | 20 | foreach ($hooks as $hook) { |
| 21 | 21 | if (isset($this->hooks[$hook])) { |
| 22 | 22 | foreach ($this->hooks[$hook] as $callback) { |
| 23 | - if($callback instanceof \Closure) { |
|
| 23 | + if ($callback instanceof \Closure) { |
|
| 24 | 24 | $callback(...$parameters); |
| 25 | 25 | } |
| 26 | 26 | } |