We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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) { |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | {{-- select_from_array column --}} |
| 2 | 2 | <span> |
| 3 | 3 | <?php |
| 4 | - if ($entry->{$column['name']} !== null) { |
|
| 5 | - echo $column['options'][$entry->{$column['name']}]; |
|
| 6 | - } else { |
|
| 7 | - echo "-"; |
|
| 8 | - } |
|
| 9 | - ?> |
|
| 4 | + if ($entry->{$column['name']} !== null) { |
|
| 5 | + echo $column['options'][$entry->{$column['name']}]; |
|
| 6 | + } else { |
|
| 7 | + echo "-"; |
|
| 8 | + } |
|
| 9 | + ?> |
|
| 10 | 10 | </span> |
@@ -116,9 +116,9 @@ |
||
| 116 | 116 | // add the details_row button to the first column |
| 117 | 117 | if ($this->details_row) { |
| 118 | 118 | $details_row_button = \View::make('crud::columns.details_row_button') |
| 119 | - ->with('crud', $this) |
|
| 120 | - ->with('entry', $entry) |
|
| 121 | - ->render(); |
|
| 119 | + ->with('crud', $this) |
|
| 120 | + ->with('entry', $entry) |
|
| 121 | + ->render(); |
|
| 122 | 122 | $row_items[0] = $details_row_button.$row_items[0]; |
| 123 | 123 | } |
| 124 | 124 | |
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | 166 | * Render the given view. |
| 167 | - * @param $view |
|
| 167 | + * @param string $view |
|
| 168 | 168 | * @param $column |
| 169 | 169 | * @param $entry |
| 170 | 170 | * @return mixed |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function applySearchTerm($searchTerm) |
| 21 | 21 | { |
| 22 | - return $this->query->where(function ($query) use ($searchTerm) { |
|
| 22 | + return $this->query->where(function($query) use ($searchTerm) { |
|
| 23 | 23 | foreach ($this->getColumns() as $column) { |
| 24 | - if (! isset($column['type'])) { |
|
| 24 | + if (!isset($column['type'])) { |
|
| 25 | 25 | abort(400, 'Missing column type when trying to apply search term.'); |
| 26 | 26 | } |
| 27 | 27 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | case 'select': |
| 62 | 62 | case 'select_multiple': |
| 63 | - $query->orWhereHas($column['entity'], function ($q) use ($column, $searchTerm) { |
|
| 63 | + $query->orWhereHas($column['entity'], function($q) use ($column, $searchTerm) { |
|
| 64 | 64 | $q->where($column['attribute'], 'like', '%'.$searchTerm.'%'); |
| 65 | 65 | }); |
| 66 | 66 | break; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | private function renderCellView($view, $column, $entry) |
| 173 | 173 | { |
| 174 | - if (! view()->exists($view)) { |
|
| 174 | + if (!view()->exists($view)) { |
|
| 175 | 175 | $view = 'crud::columns.text'; // fallback to text column |
| 176 | 176 | } |
| 177 | 177 | |
@@ -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 | |
@@ -89,6 +89,7 @@ discard block |
||
| 89 | 89 | * Upload fields are the ones that have "upload" => true defined on them. |
| 90 | 90 | * @param [form] create / update / both - defaults to 'both' |
| 91 | 91 | * @param [id] id of the entity - defaults to false |
| 92 | + * @param string $form |
|
| 92 | 93 | * @return bool |
| 93 | 94 | */ |
| 94 | 95 | public function hasUploadFields($form, $id = false) |
@@ -122,6 +123,7 @@ discard block |
||
| 122 | 123 | |
| 123 | 124 | /** |
| 124 | 125 | * Set the number of rows that should be show on the list view. |
| 126 | + * @param integer $value |
|
| 125 | 127 | */ |
| 126 | 128 | public function setDefaultPageLength($value) |
| 127 | 129 | { |
@@ -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 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | { |
| 193 | 193 | // If the default Page Length isn't in the menu's values, Add it the beginnin and resort all to show a croissant list. |
| 194 | 194 | // assume both array are the same lenght. |
| 195 | - if (! in_array($this->getDefaultPageLength(), $this->page_length_menu[0])) { |
|
| 195 | + if (!in_array($this->getDefaultPageLength(), $this->page_length_menu[0])) { |
|
| 196 | 196 | // Loop through 2 arrays of prop. page_length_menu |
| 197 | 197 | foreach ($this->page_length_menu as $key => &$page_length_choices) { |
| 198 | 198 | // This is a condition that should be always true. |
@@ -223,9 +223,9 @@ discard block |
||
| 223 | 223 | public function getPageLengthMenu() |
| 224 | 224 | { |
| 225 | 225 | // if already set, use that |
| 226 | - if (! $this->page_length_menu) { |
|
| 226 | + if (!$this->page_length_menu) { |
|
| 227 | 227 | // try to get the menu settings from the config file |
| 228 | - if (! $this->page_length_menu = config('backpack.crud.page_length_menu')) { |
|
| 228 | + if (!$this->page_length_menu = config('backpack.crud.page_length_menu')) { |
|
| 229 | 229 | // otherwise set a sensible default |
| 230 | 230 | $this->page_length_menu = [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'backpack::crud.all']]; |
| 231 | 231 | } |
@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Backpack\CRUD\app\Console\Commands; |
| 4 | 4 | |
| 5 | -use Illuminate\Console\Command; |
|
| 6 | -use Symfony\Component\Process\Process; |
|
| 7 | 5 | use Backpack\Base\app\Console\Commands\Install as BaseInstall; |
| 8 | 6 | |
| 9 | 7 | class Install extends BaseInstall |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | $this->executeProcess('mkdir -p public/uploads'); |
| 54 | 54 | break; |
| 55 | 55 | case '\\': // windows |
| 56 | - if (! file_exists('public\uploads')) { |
|
| 56 | + if (!file_exists('public\uploads')) { |
|
| 57 | 57 | $this->executeProcess('mkdir public\uploads'); |
| 58 | 58 | } |
| 59 | 59 | break; |
@@ -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 | |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Backpack\CRUD\PanelTraits; |
| 4 | 4 | |
| 5 | -use Illuminate\Database\Eloquent\Relations\HasOne; |
|
| 6 | 5 | use Illuminate\Database\Eloquent\Relations\HasMany; |
| 6 | +use Illuminate\Database\Eloquent\Relations\HasOne; |
|
| 7 | 7 | |
| 8 | 8 | trait Update |
| 9 | 9 | { |
@@ -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%" |