We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -41,12 +41,12 @@ |
||
| 41 | 41 | { |
| 42 | 42 | $this->crud->allowAccess('create'); |
| 43 | 43 | |
| 44 | - $this->crud->operation('create', function () { |
|
| 44 | + $this->crud->operation('create', function() { |
|
| 45 | 45 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
| 46 | 46 | $this->crud->setupDefaultSaveActions(); |
| 47 | 47 | }); |
| 48 | 48 | |
| 49 | - $this->crud->operation('list', function () { |
|
| 49 | + $this->crud->operation('list', function() { |
|
| 50 | 50 | $this->crud->addButton('top', 'create', 'view', 'crud::buttons.create'); |
| 51 | 51 | }); |
| 52 | 52 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | // will update the password on an actual user model and persist it to the |
| 46 | 46 | // database. Otherwise we will parse the error and return the response. |
| 47 | 47 | $response = $this->broker()->reset( |
| 48 | - $this->credentials($request), function ($user, $password) { |
|
| 48 | + $this->credentials($request), function($user, $password) { |
|
| 49 | 49 | $this->resetPassword($user, $password); |
| 50 | 50 | } |
| 51 | 51 | ); |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function verify(Request $request) |
| 36 | 36 | { |
| 37 | - if (! hash_equals((string) $request->route('id'), (string) $request->user()->getKey())) { |
|
| 37 | + if (!hash_equals((string) $request->route('id'), (string) $request->user()->getKey())) { |
|
| 38 | 38 | throw new AuthorizationException; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - if (! hash_equals((string) $request->route('hash'), sha1($request->user()->getEmailForVerification()))) { |
|
| 41 | + if (!hash_equals((string) $request->route('hash'), sha1($request->user()->getEmailForVerification()))) { |
|
| 42 | 42 | throw new AuthorizationException; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function addFakes($columns = ['extras']) |
| 21 | 21 | { |
| 22 | 22 | foreach ($columns as $key => $column) { |
| 23 | - if (! isset($this->attributes[$column])) { |
|
| 23 | + if (!isset($this->attributes[$column])) { |
|
| 24 | 24 | continue; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function shouldDecodeFake($column) |
| 71 | 71 | { |
| 72 | - return ! in_array($column, array_keys($this->casts)); |
|
| 72 | + return !in_array($column, array_keys($this->casts)); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
@@ -81,6 +81,6 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function shouldEncodeFake($column) |
| 83 | 83 | { |
| 84 | - return ! in_array($column, array_keys($this->casts)); |
|
| 84 | + return !in_array($column, array_keys($this->casts)); |
|
| 85 | 85 | } |
| 86 | 86 | } |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | public function settings() |
| 59 | 59 | { |
| 60 | - return Arr::sort($this->settings, function ($value, $key) { |
|
| 60 | + return Arr::sort($this->settings, function($value, $key) { |
|
| 61 | 61 | return $key; |
| 62 | 62 | }); |
| 63 | 63 | } |
@@ -224,10 +224,10 @@ |
||
| 224 | 224 | // add the details_row button to the first column |
| 225 | 225 | if ($this->getOperationSetting('detailsRow')) { |
| 226 | 226 | $details_row_button = \View::make('crud::columns.inc.details_row_button') |
| 227 | - ->with('crud', $this) |
|
| 228 | - ->with('entry', $entry) |
|
| 229 | - ->with('row_number', $rowNumber) |
|
| 230 | - ->render(); |
|
| 227 | + ->with('crud', $this) |
|
| 228 | + ->with('entry', $entry) |
|
| 229 | + ->with('row_number', $rowNumber) |
|
| 230 | + ->render(); |
|
| 231 | 231 | $row_items[0] = $details_row_button.$row_items[0]; |
| 232 | 232 | } |
| 233 | 233 | |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public function applySearchTerm($searchTerm) |
| 25 | 25 | { |
| 26 | - return $this->query->where(function ($query) use ($searchTerm) { |
|
| 26 | + return $this->query->where(function($query) use ($searchTerm) { |
|
| 27 | 27 | foreach ($this->columns() as $column) { |
| 28 | - if (! isset($column['type'])) { |
|
| 28 | + if (!isset($column['type'])) { |
|
| 29 | 29 | abort(400, 'Missing column type when trying to apply search term.'); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | case 'select': |
| 87 | 87 | case 'select_multiple': |
| 88 | - $query->orWhereHas($column['entity'], function ($q) use ($column, $searchTerm, $searchOperator) { |
|
| 88 | + $query->orWhereHas($column['entity'], function($q) use ($column, $searchTerm, $searchOperator) { |
|
| 89 | 89 | $q->where($this->getColumnWithTableNamePrefixed($q, $column['attribute']), $searchOperator, '%'.$searchTerm.'%'); |
| 90 | 90 | }); |
| 91 | 91 | break; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $column_number = (int) $order['column']; |
| 110 | 110 | $column_direction = (strtolower((string) $order['dir']) == 'asc' ? 'ASC' : 'DESC'); |
| 111 | 111 | $column = $this->findColumnById($column_number); |
| 112 | - if ($column['tableColumn'] && ! isset($column['orderLogic'])) { |
|
| 112 | + if ($column['tableColumn'] && !isset($column['orderLogic'])) { |
|
| 113 | 113 | if (method_exists($this->model, 'translationEnabled') && |
| 114 | 114 | $this->model->translationEnabled() && |
| 115 | 115 | $this->model->isTranslatableAttribute($column['name']) && |
@@ -136,12 +136,12 @@ discard block |
||
| 136 | 136 | $table = $this->model->getTable(); |
| 137 | 137 | $key = $this->model->getKeyName(); |
| 138 | 138 | |
| 139 | - $hasOrderByPrimaryKey = collect($orderBy)->some(function ($item) use ($key, $table) { |
|
| 139 | + $hasOrderByPrimaryKey = collect($orderBy)->some(function($item) use ($key, $table) { |
|
| 140 | 140 | return (isset($item['column']) && $item['column'] === $key) |
| 141 | 141 | || (isset($item['sql']) && str_contains($item['sql'], "$table.$key")); |
| 142 | 142 | }); |
| 143 | 143 | |
| 144 | - if (! $hasOrderByPrimaryKey) { |
|
| 144 | + if (!$hasOrderByPrimaryKey) { |
|
| 145 | 145 | $this->orderByWithPrefix($key, 'DESC'); |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -320,13 +320,13 @@ discard block |
||
| 320 | 320 | if (isset($column['type'])) { |
| 321 | 321 | // create a list of paths to column blade views |
| 322 | 322 | // including the configured view_namespaces |
| 323 | - $columnPaths = array_map(function ($item) use ($column) { |
|
| 323 | + $columnPaths = array_map(function($item) use ($column) { |
|
| 324 | 324 | return $item.'.'.$column['type']; |
| 325 | 325 | }, ViewNamespaces::getFor('columns')); |
| 326 | 326 | |
| 327 | 327 | // but always fall back to the stock 'text' column |
| 328 | 328 | // if a view doesn't exist |
| 329 | - if (! in_array('crud::columns.text', $columnPaths)) { |
|
| 329 | + if (!in_array('crud::columns.text', $columnPaths)) { |
|
| 330 | 330 | $columnPaths[] = 'crud::columns.text'; |
| 331 | 331 | } |
| 332 | 332 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | */ |
| 366 | 366 | private function renderCellView($view, $column, $entry, $rowNumber = false) |
| 367 | 367 | { |
| 368 | - if (! view()->exists($view)) { |
|
| 368 | + if (!view()->exists($view)) { |
|
| 369 | 369 | $view = 'crud::columns.text'; // fallback to text column |
| 370 | 370 | } |
| 371 | 371 | |
@@ -389,10 +389,12 @@ |
||
| 389 | 389 | return $this->fallbackLogic($value); |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | - public function else($value) |
|
| 392 | + public function else { |
|
| 393 | + ($value) |
|
| 393 | 394 | { |
| 394 | 395 | return $this->fallbackLogic($value); |
| 395 | 396 | } |
| 397 | + } |
|
| 396 | 398 | |
| 397 | 399 | // --------------- |
| 398 | 400 | // PRIVATE METHODS |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | public function __construct($options, $values, $logic, $fallbackLogic) |
| 28 | 28 | { |
| 29 | - if (! backpack_pro()) { |
|
| 29 | + if (!backpack_pro()) { |
|
| 30 | 30 | throw new BackpackProRequiredException('Filter'); |
| 31 | 31 | } |
| 32 | 32 | // if filter exists |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | public function wasNotApplied() |
| 91 | 91 | { |
| 92 | - return ! $this->applied; |
|
| 92 | + return !$this->applied; |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | $input = $input ?? new ParameterBag($this->crud()->getRequest()->all()); |
| 112 | 112 | |
| 113 | - if (! $input->has($this->name)) { |
|
| 113 | + if (!$input->has($this->name)) { |
|
| 114 | 114 | // if fallback logic was supplied and is a closure |
| 115 | 115 | if (is_callable($this->fallbackLogic)) { |
| 116 | 116 | return ($this->fallbackLogic)(); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $namespaces = array_merge([$this->viewNamespace], $namespaces); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - return array_map(function ($item) use ($type) { |
|
| 155 | + return array_map(function($item) use ($type) { |
|
| 156 | 156 | return $item.'.'.$type; |
| 157 | 157 | }, $namespaces); |
| 158 | 158 | } |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | public function values($value) |
| 316 | 316 | { |
| 317 | - $this->values = (! is_string($value) && is_callable($value)) ? $value() : $value; |
|
| 317 | + $this->values = (!is_string($value) && is_callable($value)) ? $value() : $value; |
|
| 318 | 318 | |
| 319 | 319 | return $this->save(); |
| 320 | 320 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $this->enableFilters(); |
| 73 | 73 | |
| 74 | 74 | // check if another filter with the same name exists |
| 75 | - if (! isset($options['name'])) { |
|
| 75 | + if (!isset($options['name'])) { |
|
| 76 | 76 | abort(500, 'All your filters need names.'); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $unappliedFilters = $this->filters()->where('applied', false); |
| 122 | 122 | if ($unappliedFilters->count()) { |
| 123 | - $unappliedFilters->each(function ($filter) { |
|
| 123 | + $unappliedFilters->each(function($filter) { |
|
| 124 | 124 | $filter->apply(); |
| 125 | 125 | }); |
| 126 | 126 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $filter = $this->filters()->firstWhere('name', $name); |
| 172 | 172 | |
| 173 | - if (! $filter) { |
|
| 173 | + if (!$filter) { |
|
| 174 | 174 | abort(500, 'CRUD Filter "'.$name.'" not found. Please check the filter exists before you modify it.'); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | public function replaceFilter($name, $newFilter) |
| 187 | 187 | { |
| 188 | - $newFilters = $this->filters()->map(function ($filter, $key) use ($name, $newFilter) { |
|
| 188 | + $newFilters = $this->filters()->map(function($filter, $key) use ($name, $newFilter) { |
|
| 189 | 189 | if ($filter->name != $name) { |
| 190 | 190 | return $filter; |
| 191 | 191 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | public function removeFilter($name) |
| 200 | 200 | { |
| 201 | - $strippedCollection = $this->filters()->reject(function ($filter) use ($name) { |
|
| 201 | + $strippedCollection = $this->filters()->reject(function($filter) use ($name) { |
|
| 202 | 202 | return $filter->name == $name; |
| 203 | 203 | }); |
| 204 | 204 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | */ |
| 242 | 242 | public function makeFirstFilter() |
| 243 | 243 | { |
| 244 | - if (! $this->filters()) { |
|
| 244 | + if (!$this->filters()) { |
|
| 245 | 245 | return false; |
| 246 | 246 | } |
| 247 | 247 | |
@@ -271,15 +271,15 @@ discard block |
||
| 271 | 271 | $destinationFilter = $this->firstFilterWhere('name', $destination); |
| 272 | 272 | $destinationKey = $this->getFilterKey($destination); |
| 273 | 273 | $newDestinationKey = ($where == 'before' ? $destinationKey : $destinationKey + 1); |
| 274 | - $newFilters = $this->filters()->filter(function ($value, $key) use ($target) { |
|
| 274 | + $newFilters = $this->filters()->filter(function($value, $key) use ($target) { |
|
| 275 | 275 | return $value->name != $target; |
| 276 | 276 | }); |
| 277 | 277 | |
| 278 | - if (! $targetFilter) { |
|
| 278 | + if (!$targetFilter) { |
|
| 279 | 279 | return; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | - if (! $destinationFilter) { |
|
| 282 | + if (!$destinationFilter) { |
|
| 283 | 283 | return; |
| 284 | 284 | } |
| 285 | 285 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | $lastSlice = $newFilters->slice($newDestinationKey, null); |
| 288 | 288 | |
| 289 | 289 | $newFilters = $firstSlice->push($targetFilter); |
| 290 | - $lastSlice->each(function ($item, $key) use ($newFilters) { |
|
| 290 | + $lastSlice->each(function($item, $key) use ($newFilters) { |
|
| 291 | 291 | $newFilters->push($item); |
| 292 | 292 | }); |
| 293 | 293 | |
@@ -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 |