We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $higherAction = $this->getSaveActionByOrder(1); |
| 29 | 29 | |
| 30 | 30 | //if there is an higher action and that action is not the backpack default higher one `save_and_back` we return it. |
| 31 | - if (! empty($higherAction) && key($higherAction) !== 'save_and_back') { |
|
| 31 | + if (!empty($higherAction) && key($higherAction) !== 'save_and_back') { |
|
| 32 | 32 | return key($higherAction); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function getSaveActionByOrder($order) |
| 49 | 49 | { |
| 50 | - return array_filter($this->getOperationSetting('save_actions'), function ($arr) use ($order) { |
|
| 50 | + return array_filter($this->getOperationSetting('save_actions'), function($arr) use ($order) { |
|
| 51 | 51 | return $arr['order'] == $order; |
| 52 | 52 | }); |
| 53 | 53 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $orderCounter = $this->getOperationSetting('save_actions') !== null ? (count($this->getOperationSetting('save_actions')) + 1) : 1; |
| 82 | 82 | //check for some mandatory fields |
| 83 | 83 | $saveAction['name'] ?? abort(500, 'Please define save action name.'); |
| 84 | - $saveAction['redirect'] = $saveAction['redirect'] ?? function ($crud, $request, $itemId) { |
|
| 84 | + $saveAction['redirect'] = $saveAction['redirect'] ?? function($crud, $request, $itemId) { |
|
| 85 | 85 | return $request->has('http_referrer') ? $request->get('http_referrer') : $crud->route; |
| 86 | 86 | }; |
| 87 | 87 | $saveAction['visible'] = $saveAction['visible'] ?? true; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $actions = $this->getOperationSetting('save_actions') ?? []; |
| 92 | 92 | |
| 93 | - if (! in_array($saveAction['name'], $actions)) { |
|
| 93 | + if (!in_array($saveAction['name'], $actions)) { |
|
| 94 | 94 | $actions[$saveAction['name']] = $saveAction; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | public function orderSaveAction(string $saveAction, int $wantedOrder) |
| 108 | 108 | { |
| 109 | 109 | $actions = $this->getOperationSetting('save_actions') ?? []; |
| 110 | - if (! empty($actions)) { |
|
| 110 | + if (!empty($actions)) { |
|
| 111 | 111 | $replaceOrder = isset($actions[$saveAction]) ? $actions[$saveAction]['order'] : count($actions) + 1; |
| 112 | 112 | |
| 113 | 113 | foreach ($actions as $key => $sv) { |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | public function orderSaveActions(array $saveActions) |
| 202 | 202 | { |
| 203 | 203 | foreach ($saveActions as $sv => $order) { |
| 204 | - if (! is_int($order)) { |
|
| 204 | + if (!is_int($order)) { |
|
| 205 | 205 | $this->orderSaveAction($order, $sv + 1); |
| 206 | 206 | } else { |
| 207 | 207 | $this->orderSaveAction($sv, $order); |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | { |
| 219 | 219 | $actions = $this->getOperationSetting('save_actions') ?? []; |
| 220 | 220 | |
| 221 | - uasort($actions, function ($a, $b) { |
|
| 221 | + uasort($actions, function($a, $b) { |
|
| 222 | 222 | return $a['order'] <=> $b['order']; |
| 223 | 223 | }); |
| 224 | 224 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - return array_filter($actions, function ($action) { |
|
| 243 | + return array_filter($actions, function($action) { |
|
| 244 | 244 | return $action['visible'] == true; |
| 245 | 245 | }, ARRAY_FILTER_USE_BOTH); |
| 246 | 246 | } |
@@ -304,8 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | public function setSaveAction($forceSaveAction = null) |
| 306 | 306 | { |
| 307 | - $saveAction = $forceSaveAction ?: |
|
| 308 | - \Request::input('save_action', $this->getFallBackSaveAction()); |
|
| 307 | + $saveAction = $forceSaveAction ?: \Request::input('save_action', $this->getFallBackSaveAction()); |
|
| 309 | 308 | |
| 310 | 309 | $showBubble = $this->getOperationSetting('showSaveActionChange') ?? config('backpack.crud.operations.'.$this->getCurrentOperation().'.showSaveActionChange') ?? true; |
| 311 | 310 | |
@@ -373,20 +372,20 @@ discard block |
||
| 373 | 372 | $defaultSaveActions = [ |
| 374 | 373 | [ |
| 375 | 374 | 'name' => 'save_and_back', |
| 376 | - 'visible' => function ($crud) { |
|
| 375 | + 'visible' => function($crud) { |
|
| 377 | 376 | return $crud->hasAccess('list'); |
| 378 | 377 | }, |
| 379 | - 'redirect' => function ($crud, $request, $itemId = null) { |
|
| 378 | + 'redirect' => function($crud, $request, $itemId = null) { |
|
| 380 | 379 | return $request->has('http_referrer') ? $request->get('http_referrer') : $crud->route; |
| 381 | 380 | }, |
| 382 | 381 | 'button_text' => trans('backpack::crud.save_action_save_and_back'), |
| 383 | 382 | ], |
| 384 | 383 | [ |
| 385 | 384 | 'name' => 'save_and_edit', |
| 386 | - 'visible' => function ($crud) { |
|
| 385 | + 'visible' => function($crud) { |
|
| 387 | 386 | return $crud->hasAccess('update'); |
| 388 | 387 | }, |
| 389 | - 'redirect' => function ($crud, $request, $itemId = null) { |
|
| 388 | + 'redirect' => function($crud, $request, $itemId = null) { |
|
| 390 | 389 | $itemId = $itemId ?: $request->input('id'); |
| 391 | 390 | $redirectUrl = $crud->route.'/'.$itemId.'/edit'; |
| 392 | 391 | if ($request->has('locale')) { |
@@ -398,17 +397,17 @@ discard block |
||
| 398 | 397 | |
| 399 | 398 | return $redirectUrl; |
| 400 | 399 | }, |
| 401 | - 'referrer_url' => function ($crud, $request, $itemId) { |
|
| 400 | + 'referrer_url' => function($crud, $request, $itemId) { |
|
| 402 | 401 | return url($crud->route.'/'.$itemId.'/edit'); |
| 403 | 402 | }, |
| 404 | 403 | 'button_text' => trans('backpack::crud.save_action_save_and_edit'), |
| 405 | 404 | ], |
| 406 | 405 | [ |
| 407 | 406 | 'name' => 'save_and_new', |
| 408 | - 'visible' => function ($crud) { |
|
| 407 | + 'visible' => function($crud) { |
|
| 409 | 408 | return $crud->hasAccess('create'); |
| 410 | 409 | }, |
| 411 | - 'redirect' => function ($crud, $request, $itemId = null) { |
|
| 410 | + 'redirect' => function($crud, $request, $itemId = null) { |
|
| 412 | 411 | return $this->route.'/create'; |
| 413 | 412 | }, |
| 414 | 413 | 'button_text' => trans('backpack::crud.save_action_save_and_new'), |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | return; |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - if (! $this->validCode(config('backpack.base.license_code'))) { |
|
| 31 | + if (!$this->validCode(config('backpack.base.license_code'))) { |
|
| 32 | 32 | \Alert::add('warning', "<strong>You're using unlicensed software.</strong> Please ask your web developer to <a target='_blank' class='alert-link text-white' href='http://backpackforlaravel.com'>purchase a license code</a> to hide this message."); |
| 33 | 33 | } |
| 34 | 34 | } |
@@ -46,6 +46,6 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | private function validCode($j) |
| 48 | 48 | { |
| 49 | - $k = str_replace('-', '', $j); $s = substr($k, 0, 8); $c = substr($k, 8, 2); $a = substr($k, 10, 2); $l = substr($k, 12, 2); $p = substr($k, 14, 2); $n = substr($k, 16, 2); $m = substr($k, 18, 2); $z = substr($k, 20, 24); $w = 'ADEFHKLMVWXYZ146'; $x = $s; for ($i = 0; $i < strlen($w); $i++) { $r = $w[$i]; $x = str_replace($r, '-', $x); } $x = str_replace('-', '', $x); if ($x != '') { return false; } if (substr_count($j, '-') != 5) { return false; } $e = substr(hexdec(hash('crc32b', substr($k, 0, 20))), -4); if ($z !== $e) { return false; } $o = strrev(substr(preg_replace('/[0-9]+/', '', strtoupper(sha1($a.'sand('.$s.')'.$n.'tos()'))), 2, 2)); if ($m !== $o) { return false; } $o2 = substr(((int)preg_replace('/[^0-9]/','', $s.$c)==0 ? 8310 : (int)preg_replace('/[^0-9]/','', $s.$c) )*9971, -2);if ($a !== $o2) {return false;} return true; |
|
| 49 | + $k = str_replace('-', '', $j); $s = substr($k, 0, 8); $c = substr($k, 8, 2); $a = substr($k, 10, 2); $l = substr($k, 12, 2); $p = substr($k, 14, 2); $n = substr($k, 16, 2); $m = substr($k, 18, 2); $z = substr($k, 20, 24); $w = 'ADEFHKLMVWXYZ146'; $x = $s; for ($i = 0; $i < strlen($w); $i++) { $r = $w[$i]; $x = str_replace($r, '-', $x); } $x = str_replace('-', '', $x); if ($x != '') { return false; } if (substr_count($j, '-') != 5) { return false; } $e = substr(hexdec(hash('crc32b', substr($k, 0, 20))), -4); if ($z !== $e) { return false; } $o = strrev(substr(preg_replace('/[0-9]+/', '', strtoupper(sha1($a.'sand('.$s.')'.$n.'tos()'))), 2, 2)); if ($m !== $o) { return false; } $o2 = substr(((int) preg_replace('/[^0-9]/', '', $s.$c) == 0 ? 8310 : (int) preg_replace('/[^0-9]/', '', $s.$c)) * 9971, -2); if ($a !== $o2) {return false; } return true; |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -13,5 +13,5 @@ |
||
| 13 | 13 | (array) config('backpack.base.middleware_key', 'admin') |
| 14 | 14 | ), |
| 15 | 15 | 'namespace' => 'App\Http\Controllers\Admin', |
| 16 | -], function () { // custom admin routes |
|
| 16 | +], function() { // custom admin routes |
|
| 17 | 17 | }); // this should be the absolute last line of this file |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function wasNotApplied() |
| 86 | 86 | { |
| 87 | - return ! $this->applied; |
|
| 87 | + return !$this->applied; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $input = $input ?? new ParameterBag($this->crud()->getRequest()->all()); |
| 107 | 107 | |
| 108 | - if (! $input->has($this->name)) { |
|
| 108 | + if (!$input->has($this->name)) { |
|
| 109 | 109 | // if fallback logic was supplied and is a closure |
| 110 | 110 | if (is_callable($this->fallbackLogic)) { |
| 111 | 111 | return ($this->fallbackLogic)(); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | */ |
| 286 | 286 | public function values($value) |
| 287 | 287 | { |
| 288 | - $this->values = (! is_string($value) && is_callable($value)) ? $value() : $value; |
|
| 288 | + $this->values = (!is_string($value) && is_callable($value)) ? $value() : $value; |
|
| 289 | 289 | |
| 290 | 290 | return $this->save(); |
| 291 | 291 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('addresses', function (Blueprint $table) { |
|
| 16 | + Schema::create('addresses', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->integer('account_details_id')->unsigned(); |
| 19 | 19 | $table->string('city')->nullable(); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | |
| 27 | 27 | $app['router']->get('admin/users', "$controller@index")->name('admin.users.index'); |
| 28 | 28 | |
| 29 | - $app->singleton('crud', function ($app) { |
|
| 29 | + $app->singleton('crud', function($app) { |
|
| 30 | 30 | return new CrudPanel($app); |
| 31 | 31 | }); |
| 32 | 32 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $table = $instance->getTableWithPrefix(); |
| 73 | 73 | |
| 74 | 74 | // MongoDB columns are alway nullable |
| 75 | - if (! in_array($conn->getConfig()['driver'], CRUD::getSqlDriverList())) { |
|
| 75 | + if (!in_array($conn->getConfig()['driver'], CRUD::getSqlDriverList())) { |
|
| 76 | 76 | return true; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | // check for NOT NULL |
| 83 | 83 | $notNull = $column->getNotnull(); |
| 84 | 84 | // return the value of nullable (aka the inverse of NOT NULL) |
| 85 | - return ! $notNull; |
|
| 85 | + return !$notNull; |
|
| 86 | 86 | } catch (\Exception $e) { |
| 87 | 87 | return true; |
| 88 | 88 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $id = $this->getCurrentEntryId(); |
| 40 | 40 | |
| 41 | - if (! $id) { |
|
| 41 | + if (!$id) { |
|
| 42 | 42 | return false; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function getEntry($id) |
| 56 | 56 | { |
| 57 | - if (! $this->entry) { |
|
| 57 | + if (!$this->entry) { |
|
| 58 | 58 | $this->entry = $this->model->findOrFail($id); |
| 59 | 59 | $this->entry = $this->entry->withFakes(); |
| 60 | 60 | } |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | // we will apply the same labels as the values to the menu if developer didn't |
| 245 | 245 | $this->abortIfInvalidPageLength($menu[0]); |
| 246 | 246 | |
| 247 | - if (! isset($menu[1]) || ! is_array($menu[1])) { |
|
| 247 | + if (!isset($menu[1]) || !is_array($menu[1])) { |
|
| 248 | 248 | $menu[1] = $menu[0]; |
| 249 | 249 | } |
| 250 | 250 | } else { |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $this->crud->allowAccess('list'); |
| 43 | 43 | |
| 44 | - $this->crud->operation('list', function () { |
|
| 44 | + $this->crud->operation('list', function() { |
|
| 45 | 45 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
| 46 | 46 | }); |
| 47 | 47 | } |
@@ -116,12 +116,12 @@ discard block |
||
| 116 | 116 | $table = $this->crud->model->getTable(); |
| 117 | 117 | $key = $this->crud->model->getKeyName(); |
| 118 | 118 | |
| 119 | - $hasOrderByPrimaryKey = collect($orderBy)->some(function ($item) use ($key, $table) { |
|
| 119 | + $hasOrderByPrimaryKey = collect($orderBy)->some(function($item) use ($key, $table) { |
|
| 120 | 120 | return (isset($item['column']) && $item['column'] === $key) |
| 121 | 121 | || (isset($item['sql']) && str_contains($item['sql'], "$table.$key")); |
| 122 | 122 | }); |
| 123 | 123 | |
| 124 | - if (! $hasOrderByPrimaryKey) { |
|
| 124 | + if (!$hasOrderByPrimaryKey) { |
|
| 125 | 125 | $this->crud->orderByWithPrefix($this->crud->model->getKeyName(), 'DESC'); |
| 126 | 126 | } |
| 127 | 127 | |