We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * Move the most recently added column after the given target column. |
134 | 134 | * |
135 | - * @param string|array $targetColumn The target column name or array. |
|
135 | + * @param string $targetColumn The target column name or array. |
|
136 | 136 | */ |
137 | 137 | public function afterColumn($targetColumn) |
138 | 138 | { |
@@ -278,6 +278,7 @@ discard block |
||
278 | 278 | * |
279 | 279 | * @param [string] Column name. |
280 | 280 | * @param [attributes and values array] |
281 | + * @param string $column |
|
281 | 282 | */ |
282 | 283 | public function setColumnDetails($column, $attributes) |
283 | 284 | { |
@@ -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 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function makeFirstColumn() |
156 | 156 | { |
157 | - if (! $this->columns) { |
|
157 | + if (!$this->columns) { |
|
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | |
@@ -175,8 +175,7 @@ discard block |
||
175 | 175 | $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn; |
176 | 176 | |
177 | 177 | if (array_key_exists($targetColumnName, $this->columns)) { |
178 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : |
|
179 | - array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
178 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
180 | 179 | |
181 | 180 | $element = array_pop($this->columns); |
182 | 181 | $beginningPart = array_slice($this->columns, 0, $targetColumnPosition, true); |
@@ -210,7 +209,7 @@ discard block |
||
210 | 209 | */ |
211 | 210 | public function addDefaultLabel($array) |
212 | 211 | { |
213 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
212 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
214 | 213 | $array = array_merge(['label' => ucfirst($this->makeLabel($array['name']))], $array); |
215 | 214 | |
216 | 215 | return $array; |
@@ -236,7 +235,7 @@ discard block |
||
236 | 235 | */ |
237 | 236 | public function removeColumns($columns) |
238 | 237 | { |
239 | - if (! empty($columns)) { |
|
238 | + if (!empty($columns)) { |
|
240 | 239 | foreach ($columns as $columnName) { |
241 | 240 | $this->removeColumn($columnName); |
242 | 241 | } |
@@ -257,8 +256,8 @@ discard block |
||
257 | 256 | */ |
258 | 257 | public function remove($entity, $fields) |
259 | 258 | { |
260 | - return array_values(array_filter($this->{$entity}, function ($field) use ($fields) { |
|
261 | - return ! in_array($field['name'], (array) $fields); |
|
259 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { |
|
260 | + return !in_array($field['name'], (array) $fields); |
|
262 | 261 | })); |
263 | 262 | } |
264 | 263 | |
@@ -303,7 +302,7 @@ discard block |
||
303 | 302 | { |
304 | 303 | $columns = $this->getColumns(); |
305 | 304 | |
306 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
305 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
307 | 306 | return $value == null; |
308 | 307 | })->toArray(); |
309 | 308 | } |
@@ -119,10 +119,10 @@ |
||
119 | 119 | // add the details_row button to the first column |
120 | 120 | if ($this->details_row) { |
121 | 121 | $details_row_button = \View::make('crud::columns.details_row_button') |
122 | - ->with('crud', $this) |
|
123 | - ->with('entry', $entry) |
|
124 | - ->with('row_number', $rowNumber) |
|
125 | - ->render(); |
|
122 | + ->with('crud', $this) |
|
123 | + ->with('entry', $entry) |
|
124 | + ->with('row_number', $rowNumber) |
|
125 | + ->render(); |
|
126 | 126 | $row_items[0] = $details_row_button.$row_items[0]; |
127 | 127 | } |
128 | 128 |
@@ -169,7 +169,7 @@ |
||
169 | 169 | |
170 | 170 | /** |
171 | 171 | * Render the given view. |
172 | - * @param $view |
|
172 | + * @param string $view |
|
173 | 173 | * @param $column |
174 | 174 | * @param $entry |
175 | 175 | * @param int The number shown to the user as row number (index); |
@@ -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; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | private function renderCellView($view, $column, $entry, $rowNumber = false) |
179 | 179 | { |
180 | - if (! view()->exists($view)) { |
|
180 | + if (!view()->exists($view)) { |
|
181 | 181 | $view = 'crud::columns.text'; // fallback to text column |
182 | 182 | } |
183 | 183 |
@@ -174,7 +174,7 @@ |
||
174 | 174 | { |
175 | 175 | $this->crud->hasAccessOrFail('reorder'); |
176 | 176 | |
177 | - if (! $this->crud->isReorderEnabled()) { |
|
177 | + if (!$this->crud->isReorderEnabled()) { |
|
178 | 178 | abort(403, 'Reorder is disabled.'); |
179 | 179 | } |
180 | 180 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $this->crud->hasAccessOrFail('revisions'); |
42 | 42 | |
43 | 43 | $revisionId = \Request::input('revision_id', false); |
44 | - if (! $revisionId) { |
|
44 | + if (!$revisionId) { |
|
45 | 45 | abort(500, 'Can\'t restore revision without revision_id'); |
46 | 46 | } else { |
47 | 47 | $this->crud->restoreRevision($id, $revisionId); // do the update |
@@ -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) { |