We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function addColumn($column) |
| 65 | 65 | { |
| 66 | 66 | // if a string was passed, not an array, change it to an array |
| 67 | - if (! is_array($column)) { |
|
| 67 | + if (!is_array($column)) { |
|
| 68 | 68 | $column = ['name' => $column]; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $column_with_details = $this->addDefaultLabel($column); |
| 73 | 73 | |
| 74 | 74 | // make sure the column has a name |
| 75 | - if (! array_key_exists('name', $column_with_details)) { |
|
| 75 | + if (!array_key_exists('name', $column_with_details)) { |
|
| 76 | 76 | $column_with_details['name'] = 'anonymous_column_'.str_random(5); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -80,27 +80,27 @@ discard block |
||
| 80 | 80 | $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']); |
| 81 | 81 | |
| 82 | 82 | // make sure the column has a type |
| 83 | - if (! array_key_exists('type', $column_with_details)) { |
|
| 83 | + if (!array_key_exists('type', $column_with_details)) { |
|
| 84 | 84 | $column_with_details['type'] = 'text'; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // make sure the column has a key |
| 88 | - if (! array_key_exists('key', $column_with_details)) { |
|
| 88 | + if (!array_key_exists('key', $column_with_details)) { |
|
| 89 | 89 | $column_with_details['key'] = $column_with_details['name']; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // make sure the column has a tableColumn boolean |
| 93 | - if (! array_key_exists('tableColumn', $column_with_details)) { |
|
| 93 | + if (!array_key_exists('tableColumn', $column_with_details)) { |
|
| 94 | 94 | $column_with_details['tableColumn'] = $columnExistsInDb ? true : false; |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // make sure the column has a orderable boolean |
| 98 | - if (! array_key_exists('orderable', $column_with_details)) { |
|
| 98 | + if (!array_key_exists('orderable', $column_with_details)) { |
|
| 99 | 99 | $column_with_details['orderable'] = $columnExistsInDb ? true : false; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | // make sure the column has a searchLogic |
| 103 | - if (! array_key_exists('searchLogic', $column_with_details)) { |
|
| 103 | + if (!array_key_exists('searchLogic', $column_with_details)) { |
|
| 104 | 104 | $column_with_details['searchLogic'] = $columnExistsInDb ? true : false; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
| 110 | 110 | // defined in the main model |
| 111 | - if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) { |
|
| 111 | + if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) { |
|
| 112 | 112 | $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']); |
| 113 | 113 | } |
| 114 | 114 | |
@@ -162,8 +162,7 @@ discard block |
||
| 162 | 162 | $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn; |
| 163 | 163 | |
| 164 | 164 | if (array_key_exists($targetColumnName, $this->columns)) { |
| 165 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : |
|
| 166 | - array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
| 165 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
| 167 | 166 | |
| 168 | 167 | $element = array_pop($this->columns); |
| 169 | 168 | $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true); |
@@ -197,7 +196,7 @@ discard block |
||
| 197 | 196 | */ |
| 198 | 197 | public function addDefaultLabel($array) |
| 199 | 198 | { |
| 200 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
| 199 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
| 201 | 200 | $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array); |
| 202 | 201 | |
| 203 | 202 | return $array; |
@@ -223,7 +222,7 @@ discard block |
||
| 223 | 222 | */ |
| 224 | 223 | public function removeColumns($columns) |
| 225 | 224 | { |
| 226 | - if (! empty($columns)) { |
|
| 225 | + if (!empty($columns)) { |
|
| 227 | 226 | foreach ($columns as $columnName) { |
| 228 | 227 | $this->removeColumn($columnName); |
| 229 | 228 | } |
@@ -244,8 +243,8 @@ discard block |
||
| 244 | 243 | */ |
| 245 | 244 | public function remove($entity, $fields) |
| 246 | 245 | { |
| 247 | - return array_values(array_filter($this->{$entity}, function ($field) use ($fields) { |
|
| 248 | - return ! in_array($field['name'], (array) $fields); |
|
| 246 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { |
|
| 247 | + return !in_array($field['name'], (array) $fields); |
|
| 249 | 248 | })); |
| 250 | 249 | } |
| 251 | 250 | |
@@ -290,7 +289,7 @@ discard block |
||
| 290 | 289 | { |
| 291 | 290 | $columns = $this->getColumns(); |
| 292 | 291 | |
| 293 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
| 292 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
| 294 | 293 | return $value == null; |
| 295 | 294 | })->toArray(); |
| 296 | 295 | } |
@@ -22,11 +22,11 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | $saveOptions = collect($permissions) |
| 24 | 24 | // Restrict list to allowed actions. |
| 25 | - ->filter(function ($action, $permission) { |
|
| 25 | + ->filter(function($action, $permission) { |
|
| 26 | 26 | return $this->crud->hasAccess($permission); |
| 27 | 27 | }) |
| 28 | 28 | // Generate list of possible actions. |
| 29 | - ->mapWithKeys(function ($action, $permission) { |
|
| 29 | + ->mapWithKeys(function($action, $permission) { |
|
| 30 | 30 | return [$action => $this->getSaveActionButtonName($action)]; |
| 31 | 31 | }) |
| 32 | 32 | ->all(); |
@@ -61,8 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function setSaveAction($forceSaveAction = null) |
| 63 | 63 | { |
| 64 | - $saveAction = $forceSaveAction ?: |
|
| 65 | - \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back')); |
|
| 64 | + $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back')); |
|
| 66 | 65 | |
| 67 | 66 | if (config('backpack.crud.show_save_action_change', true) && |
| 68 | 67 | session('save_action', 'save_and_back') !== $saveAction) { |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $this->setDoctrineTypesMapping(); |
| 23 | 23 | $this->getDbColumnTypes(); |
| 24 | 24 | |
| 25 | - array_map(function ($field) { |
|
| 25 | + array_map(function($field) { |
|
| 26 | 26 | $new_field = [ |
| 27 | 27 | 'name' => $field, |
| 28 | 28 | 'label' => $this->makeLabel($field), |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | 'attributes' => [], |
| 34 | 34 | 'autoset' => true, |
| 35 | 35 | ]; |
| 36 | - if (! isset($this->create_fields[$field])) { |
|
| 36 | + if (!isset($this->create_fields[$field])) { |
|
| 37 | 37 | $this->create_fields[$field] = $new_field; |
| 38 | 38 | } |
| 39 | - if (! isset($this->update_fields[$field])) { |
|
| 39 | + if (!isset($this->update_fields[$field])) { |
|
| 40 | 40 | $this->update_fields[$field] = $new_field; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! in_array($field, $this->model->getHidden()) && ! isset($this->columns[$field])) { |
|
| 43 | + if (!in_array($field, $this->model->getHidden()) && !isset($this->columns[$field])) { |
|
| 44 | 44 | $this->addColumn([ |
| 45 | 45 | 'name' => $field, |
| 46 | 46 | 'label' => $this->makeLabel($field), |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getFieldTypeFromDbColumnType($field) |
| 82 | 82 | { |
| 83 | - if (! array_key_exists($field, $this->db_column_types)) { |
|
| 83 | + if (!array_key_exists($field, $this->db_column_types)) { |
|
| 84 | 84 | return 'text'; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $types = ['enum' => 'string']; |
| 148 | 148 | $platform = \DB::getDoctrineConnection()->getDatabasePlatform(); |
| 149 | 149 | foreach ($types as $type_key => $type_value) { |
| 150 | - if (! $platform->hasDoctrineTypeMappingFor($type_key)) { |
|
| 150 | + if (!$platform->hasDoctrineTypeMappingFor($type_key)) { |
|
| 151 | 151 | $platform->registerDoctrineTypeMapping($type_key, $type_value); |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable()); |
| 203 | 203 | $fillable = $this->model->getFillable(); |
| 204 | 204 | |
| 205 | - if (! empty($fillable)) { |
|
| 205 | + if (!empty($fillable)) { |
|
| 206 | 206 | $columns = array_intersect($columns, $fillable); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function register() |
| 78 | 78 | { |
| 79 | - $this->app->bind('CRUD', function ($app) { |
|
| 79 | + $this->app->bind('CRUD', function($app) { |
|
| 80 | 80 | return new CRUD($app); |
| 81 | 81 | }); |
| 82 | 82 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $this->commands($this->commands); |
| 92 | 92 | |
| 93 | 93 | // map the elfinder prefix |
| 94 | - if (! \Config::get('elfinder.route.prefix')) { |
|
| 94 | + if (!\Config::get('elfinder.route.prefix')) { |
|
| 95 | 95 | \Config::set('elfinder.route.prefix', \Config::get('backpack.base.route_prefix').'/elfinder'); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $crudPubPath = public_path('vendor/backpack/crud'); |
| 113 | 113 | |
| 114 | - if (! is_dir($crudPubPath)) { |
|
| 114 | + if (!is_dir($crudPubPath)) { |
|
| 115 | 115 | return true; |
| 116 | 116 | } |
| 117 | 117 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | foreach ($fields as &$field) { |
| 53 | 53 | // set the value |
| 54 | - if (! isset($field['value'])) { |
|
| 54 | + if (!isset($field['value'])) { |
|
| 55 | 55 | if (isset($field['subfields'])) { |
| 56 | 56 | $field['value'] = []; |
| 57 | 57 | foreach ($field['subfields'] as $subfield) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // always have a hidden input for the entry id |
| 67 | - if (! array_key_exists('id', $fields)) { |
|
| 67 | + if (!array_key_exists('id', $fields)) { |
|
| 68 | 68 | $fields['id'] = [ |
| 69 | 69 | 'name' => $entry->getKeyName(), |
| 70 | 70 | 'value' => $entry->getKey(), |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | if (isset($field['entity'])) { |
| 89 | 89 | $relationArray = explode('.', $field['entity']); |
| 90 | - $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function ($obj, $method) { |
|
| 90 | + $relatedModel = array_reduce(array_splice($relationArray, 0, -1), function($obj, $method) { |
|
| 91 | 91 | return $obj->{$method} ? $obj->{$method} : $obj; |
| 92 | 92 | }, $model); |
| 93 | 93 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | <label>{!! $field['label'] !!}</label> |
| 6 | 6 | @include('crud::inc.field_translatable_icon') |
| 7 | 7 | |
| 8 | - <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
| 8 | + <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
| 9 | 9 | <select |
| 10 | 10 | name="{{ $field['name'] }}" |
| 11 | 11 | @include('crud::inc.field_attributes') |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | <div @include('crud::inc.field_wrapper_attributes') > |
| 3 | 3 | <label>{!! $field['label'] !!}</label> |
| 4 | 4 | @include('crud::inc.field_translatable_icon') |
| 5 | - <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
| 5 | + <?php $entity_model = $crud->getRelationModel($field['entity'], - 1); ?> |
|
| 6 | 6 | <select |
| 7 | 7 | name="{{ $field['name'] }}" |
| 8 | 8 | style="width: 100%" |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $all_relation_fields = $this->getRelationFields($form); |
| 92 | 92 | |
| 93 | - return array_where($all_relation_fields, function ($value, $key) { |
|
| 93 | + return array_where($all_relation_fields, function($value, $key) { |
|
| 94 | 94 | return isset($value['pivot']) && $value['pivot']; |
| 95 | 95 | }); |
| 96 | 96 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | private function createRelationsForItem($item, $formattedData) |
| 163 | 163 | { |
| 164 | - if (! isset($formattedData['relations'])) { |
|
| 164 | + if (!isset($formattedData['relations'])) { |
|
| 165 | 165 | return false; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -219,11 +219,11 @@ discard block |
||
| 219 | 219 | $key = implode('.relations.', explode('.', $relationField['entity'])); |
| 220 | 220 | $fieldData = array_get($relationData, 'relations.'.$key, []); |
| 221 | 221 | |
| 222 | - if (! array_key_exists('model', $fieldData)) { |
|
| 222 | + if (!array_key_exists('model', $fieldData)) { |
|
| 223 | 223 | $fieldData['model'] = $relationField['model']; |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - if (! array_key_exists('parent', $fieldData)) { |
|
| 226 | + if (!array_key_exists('parent', $fieldData)) { |
|
| 227 | 227 | $fieldData['parent'] = $this->getRelationModel($relationField['entity'], -1); |
| 228 | 228 | } |
| 229 | 229 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $id = $this->getCurrentEntryId(); |
| 43 | 43 | |
| 44 | - if (! $id) { |
|
| 44 | + if (!$id) { |
|
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function getEntry($id) |
| 59 | 59 | { |
| 60 | - if (! $this->entry) { |
|
| 60 | + if (!$this->entry) { |
|
| 61 | 61 | $this->entry = $this->model->findOrFail($id); |
| 62 | 62 | $this->entry = $this->entry->withFakes(); |
| 63 | 63 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | public function hasUploadFields($form, $id = false) |
| 133 | 133 | { |
| 134 | 134 | $fields = $this->getFields($form, $id); |
| 135 | - $upload_fields = array_where($fields, function ($value, $key) { |
|
| 135 | + $upload_fields = array_where($fields, function($value, $key) { |
|
| 136 | 136 | return isset($value['upload']) && $value['upload'] == true; |
| 137 | 137 | }); |
| 138 | 138 | |
@@ -204,9 +204,9 @@ discard block |
||
| 204 | 204 | public function getPageLengthMenu() |
| 205 | 205 | { |
| 206 | 206 | // if already set, use that |
| 207 | - if (! $this->page_length_menu) { |
|
| 207 | + if (!$this->page_length_menu) { |
|
| 208 | 208 | // try to get the menu settings from the config file |
| 209 | - if (! $this->page_length_menu = config('backpack.crud.page_length_menu')) { |
|
| 209 | + if (!$this->page_length_menu = config('backpack.crud.page_length_menu')) { |
|
| 210 | 210 | // otherwise set a sensible default |
| 211 | 211 | $this->page_length_menu = [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']]; |
| 212 | 212 | } |