We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | (array) config('backpack.base.middleware_key', 'admin'), |
| 23 | 23 | 'prefix' => config('backpack.base.route_prefix', 'admin'), |
| 24 | 24 | ], |
| 25 | - function () { |
|
| 25 | + function() { |
|
| 26 | 26 | Route::crud('users', 'Backpack\CRUD\Tests\Unit\Http\Controllers\UserCrudController'); |
| 27 | 27 | } |
| 28 | 28 | ); |
@@ -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 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public function customOrderBy($column, $columnDirection = 'asc') |
| 101 | 101 | { |
| 102 | - if (! isset($column['orderLogic'])) { |
|
| 102 | + if (!isset($column['orderLogic'])) { |
|
| 103 | 103 | return $this->query; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | public function getTotalQueryCount() |
| 191 | 191 | { |
| 192 | - if (! $this->getOperationSetting('showEntryCount')) { |
|
| 192 | + if (!$this->getOperationSetting('showEntryCount')) { |
|
| 193 | 193 | return 0; |
| 194 | 194 | } |
| 195 | 195 | |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | */ |
| 229 | 229 | private function getCountFromQuery(Builder $query) |
| 230 | 230 | { |
| 231 | - if (! $this->driverIsSql()) { |
|
| 231 | + if (!$this->driverIsSql()) { |
|
| 232 | 232 | return $query->count(); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | $expressionColumns = []; |
| 248 | 248 | |
| 249 | 249 | foreach ($crudQuery->columns ?? [] as $column) { |
| 250 | - if (! is_string($column) && is_a($column, 'Illuminate\Database\Query\Expression')) { |
|
| 250 | + if (!is_string($column) && is_a($column, 'Illuminate\Database\Query\Expression')) { |
|
| 251 | 251 | $expressionColumns[] = $column; |
| 252 | 252 | } |
| 253 | 253 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | |
| 24 | 24 | try { |
| 25 | 25 | $select = app()->version() < 10 ? |
| 26 | - DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"') : |
|
| 27 | - DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"')->getValue($connection->getQueryGrammar()); |
|
| 26 | + DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"') : DB::raw('SHOW COLUMNS FROM `'.$table_prefix.$instance->getTable().'` WHERE Field = "'.$field_name.'"')->getValue($connection->getQueryGrammar()); |
|
| 28 | 27 | |
| 29 | 28 | $type = $connection->select($select)[0]->Type; |
| 30 | 29 | } catch (\Exception $e) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | <?php |
| 29 | 29 | function tree_element($entry, $key, $all_entries, $crud) |
| 30 | 30 | { |
| 31 | - if (! isset($entry->tree_element_shown)) { |
|
| 31 | + if (!isset($entry->tree_element_shown)) { |
|
| 32 | 32 | // mark the element as shown |
| 33 | 33 | $all_entries[$key]->tree_element_shown = true; |
| 34 | 34 | $entry->tree_element_shown = true; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | <ol class="sortable mt-0"> |
| 72 | 72 | <?php |
| 73 | 73 | $all_entries = collect($entries->all())->sortBy('lft')->keyBy($crud->getModel()->getKeyName()); |
| 74 | - $root_entries = $all_entries->filter(function ($item) { |
|
| 74 | + $root_entries = $all_entries->filter(function($item) { |
|
| 75 | 75 | return $item->parent_id == 0; |
| 76 | 76 | }); |
| 77 | 77 | foreach ($root_entries as $key => $entry) { |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | // we get the first column from database |
| 64 | 64 | // that is NOT indexed (usually primary, foreign keys) |
| 65 | 65 | foreach ($columns as $columnName => $columnProperties) { |
| 66 | - if (! in_array($columnName, $indexedColumns)) { |
|
| 66 | + if (!in_array($columnName, $indexedColumns)) { |
|
| 67 | 67 | //check for convention "field<_id>" in case developer didn't add foreign key constraints. |
| 68 | 68 | if (strpos($columnName, '_id') !== false) { |
| 69 | 69 | continue; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | 'middleware' => config('backpack.base.web_middleware', 'web'), |
| 19 | 19 | 'prefix' => config('backpack.base.route_prefix'), |
| 20 | 20 | ], |
| 21 | - function () { |
|
| 21 | + function() { |
|
| 22 | 22 | // if not otherwise configured, setup the auth routes |
| 23 | 23 | if (config('backpack.base.setup_auth_routes')) { |
| 24 | 24 | // Authentication Routes... |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function afterField($targetFieldName) |
| 140 | 140 | { |
| 141 | - $this->transformFields(function ($fields) use ($targetFieldName) { |
|
| 141 | + $this->transformFields(function($fields) use ($targetFieldName) { |
|
| 142 | 142 | return $this->moveField($fields, $targetFieldName, false); |
| 143 | 143 | }); |
| 144 | 144 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function beforeField($targetFieldName) |
| 152 | 152 | { |
| 153 | - $this->transformFields(function ($fields) use ($targetFieldName) { |
|
| 153 | + $this->transformFields(function($fields) use ($targetFieldName) { |
|
| 154 | 154 | return $this->moveField($fields, $targetFieldName, true); |
| 155 | 155 | }); |
| 156 | 156 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | */ |
| 163 | 163 | public function makeFirstField() |
| 164 | 164 | { |
| 165 | - if (! $this->fields()) { |
|
| 165 | + if (!$this->fields()) { |
|
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | public function removeField($name) |
| 179 | 179 | { |
| 180 | - $this->transformFields(function ($fields) use ($name) { |
|
| 180 | + $this->transformFields(function($fields) use ($name) { |
|
| 181 | 181 | Arr::forget($fields, $name); |
| 182 | 182 | |
| 183 | 183 | return $fields; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | public function removeFields($array_of_names) |
| 193 | 193 | { |
| 194 | - if (! empty($array_of_names)) { |
|
| 194 | + if (!empty($array_of_names)) { |
|
| 195 | 195 | foreach ($array_of_names as $name) { |
| 196 | 196 | $this->removeField($name); |
| 197 | 197 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | public function removeAllFields() |
| 205 | 205 | { |
| 206 | 206 | $current_fields = $this->getCleanStateFields(); |
| 207 | - if (! empty($current_fields)) { |
|
| 207 | + if (!empty($current_fields)) { |
|
| 208 | 208 | foreach ($current_fields as $field) { |
| 209 | 209 | $this->removeField($field['name']); |
| 210 | 210 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | $jsonCastables = ['array', 'object', 'json']; |
| 300 | 300 | $fieldCasting = $casted_attributes[$field['name']]; |
| 301 | 301 | |
| 302 | - if (in_array($fieldCasting, $jsonCastables) && isset($input[$field['name']]) && ! empty($input[$field['name']]) && ! is_array($input[$field['name']])) { |
|
| 302 | + if (in_array($fieldCasting, $jsonCastables) && isset($input[$field['name']]) && !empty($input[$field['name']]) && !is_array($input[$field['name']])) { |
|
| 303 | 303 | try { |
| 304 | 304 | $input[$field['name']] = json_decode($input[$field['name']]); |
| 305 | 305 | } catch (\Exception $e) { |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function orderFields($order) |
| 330 | 330 | { |
| 331 | - $this->transformFields(function ($fields) use ($order) { |
|
| 331 | + $this->transformFields(function($fields) use ($order) { |
|
| 332 | 332 | return $this->applyOrderToFields($fields, $order); |
| 333 | 333 | }); |
| 334 | 334 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | public function hasUploadFields() |
| 355 | 355 | { |
| 356 | 356 | $fields = $this->getCleanStateFields(); |
| 357 | - $upload_fields = Arr::where($fields, function ($value, $key) { |
|
| 357 | + $upload_fields = Arr::where($fields, function($value, $key) { |
|
| 358 | 358 | // check if any subfields have uploads |
| 359 | 359 | if (isset($value['subfields'])) { |
| 360 | 360 | foreach ($value['subfields'] as $subfield) { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $alreadyLoaded = $this->getLoadedFieldTypes(); |
| 427 | 427 | $type = $this->getFieldTypeWithNamespace($field); |
| 428 | 428 | |
| 429 | - if (! in_array($type, $this->getLoadedFieldTypes(), true)) { |
|
| 429 | + if (!in_array($type, $this->getLoadedFieldTypes(), true)) { |
|
| 430 | 430 | $alreadyLoaded[] = $type; |
| 431 | 431 | $this->setLoadedFieldTypes($alreadyLoaded); |
| 432 | 432 | |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | */ |
| 468 | 468 | public function fieldTypeNotLoaded($field) |
| 469 | 469 | { |
| 470 | - return ! in_array($this->getFieldTypeWithNamespace($field), $this->getLoadedFieldTypes()); |
|
| 470 | + return !in_array($this->getFieldTypeWithNamespace($field), $this->getLoadedFieldTypes()); |
|
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | /** |
@@ -516,7 +516,7 @@ discard block |
||
| 516 | 516 | */ |
| 517 | 517 | public function hasFieldWhere($attribute, $value) |
| 518 | 518 | { |
| 519 | - $match = Arr::first($this->getCleanStateFields(), function ($field, $fieldKey) use ($attribute, $value) { |
|
| 519 | + $match = Arr::first($this->getCleanStateFields(), function($field, $fieldKey) use ($attribute, $value) { |
|
| 520 | 520 | return isset($field[$attribute]) && $field[$attribute] == $value; |
| 521 | 521 | }); |
| 522 | 522 | |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | */ |
| 533 | 533 | public function firstFieldWhere($attribute, $value) |
| 534 | 534 | { |
| 535 | - return Arr::first($this->getCleanStateFields(), function ($field, $fieldKey) use ($attribute, $value) { |
|
| 535 | + return Arr::first($this->getCleanStateFields(), function($field, $fieldKey) use ($attribute, $value) { |
|
| 536 | 536 | return isset($field[$attribute]) && $field[$attribute] == $value; |
| 537 | 537 | }); |
| 538 | 538 | } |
@@ -66,24 +66,24 @@ discard block |
||
| 66 | 66 | include_once __DIR__.'/macros.php'; |
| 67 | 67 | |
| 68 | 68 | // Bind the CrudPanel object to Laravel's service container |
| 69 | - $this->app->scoped('crud', function ($app) { |
|
| 69 | + $this->app->scoped('crud', function($app) { |
|
| 70 | 70 | return new CrudPanel(); |
| 71 | 71 | }); |
| 72 | 72 | |
| 73 | - $this->app->scoped('DatabaseSchema', function ($app) { |
|
| 73 | + $this->app->scoped('DatabaseSchema', function($app) { |
|
| 74 | 74 | return new DatabaseSchema(); |
| 75 | 75 | }); |
| 76 | 76 | |
| 77 | - $this->app->singleton('BackpackViewNamespaces', function ($app) { |
|
| 77 | + $this->app->singleton('BackpackViewNamespaces', function($app) { |
|
| 78 | 78 | return new ViewNamespaces(); |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | 81 | // Bind the widgets collection object to Laravel's service container |
| 82 | - $this->app->singleton('widgets', function ($app) { |
|
| 82 | + $this->app->singleton('widgets', function($app) { |
|
| 83 | 83 | return new Collection(); |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | - $this->app->scoped('UploadersRepository', function ($app) { |
|
| 86 | + $this->app->scoped('UploadersRepository', function($app) { |
|
| 87 | 87 | return new UploadersRepository(); |
| 88 | 88 | }); |
| 89 | 89 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $middleware_key = config('backpack.base.middleware_key'); |
| 100 | 100 | $middleware_class = config('backpack.base.middleware_class'); |
| 101 | 101 | |
| 102 | - if (! is_array($middleware_class)) { |
|
| 102 | + if (!is_array($middleware_class)) { |
|
| 103 | 103 | $router->pushMiddlewareToGroup($middleware_key, $middleware_class); |
| 104 | 104 | |
| 105 | 105 | return; |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | $operationConfigs = scandir(__DIR__.'/config/backpack/operations/'); |
| 216 | 216 | $operationConfigs = array_diff($operationConfigs, ['.', '..']); |
| 217 | 217 | |
| 218 | - if (! count($operationConfigs)) { |
|
| 218 | + if (!count($operationConfigs)) { |
|
| 219 | 219 | return; |
| 220 | 220 | } |
| 221 | 221 | |