We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | |
25 | 25 | $saveOptions = collect($permissions) |
26 | 26 | // Restrict list to allowed actions. |
27 | - ->filter(function ($action, $permission) { |
|
27 | + ->filter(function($action, $permission) { |
|
28 | 28 | return $this->hasAccess($permission); |
29 | 29 | }) |
30 | 30 | // Generate list of possible actions. |
31 | - ->mapWithKeys(function ($action, $permission) { |
|
31 | + ->mapWithKeys(function($action, $permission) { |
|
32 | 32 | return [$action => $this->getSaveActionButtonName($action)]; |
33 | 33 | }) |
34 | 34 | ->all(); |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function setSaveAction($forceSaveAction = null) |
65 | 65 | { |
66 | - $saveAction = $forceSaveAction ?: |
|
67 | - \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back')); |
|
66 | + $saveAction = $forceSaveAction ?: \Request::input('save_action', config('backpack.crud.default_save_action', 'save_and_back')); |
|
68 | 67 | |
69 | 68 | if (config('backpack.crud.show_save_action_change', true) && |
70 | 69 | session('save_action', 'save_and_back') !== $saveAction) { |
@@ -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 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->set($op.'.access', false); |
34 | 34 | } |
35 | 35 | |
36 | - return ! $this->hasAccessToAny($operation); |
|
36 | + return !$this->hasAccessToAny($operation); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function hasAccessToAll($operation_array) |
74 | 74 | { |
75 | 75 | foreach ((array) $operation_array as $key => $operation) { |
76 | - if (! $this->get($operation.'.access')) { |
|
76 | + if (!$this->get($operation.'.access')) { |
|
77 | 77 | return false; |
78 | 78 | } |
79 | 79 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function hasAccessOrFail($operation) |
92 | 92 | { |
93 | - if (! $this->get($operation.'.access')) { |
|
93 | + if (!$this->get($operation.'.access')) { |
|
94 | 94 | throw new AccessDeniedException(trans('backpack::crud.unauthorized_access', ['access' => $operation])); |
95 | 95 | } |
96 | 96 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $this->enableFilters(); |
60 | 60 | |
61 | 61 | // check if another filter with the same name exists |
62 | - if (! isset($options['name'])) { |
|
62 | + if (!isset($options['name'])) { |
|
63 | 63 | abort(500, 'All your filters need names.'); |
64 | 64 | } |
65 | 65 | if ($this->filters()->contains('name', $options['name'])) { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | { |
202 | 202 | $filter = $this->filters()->firstWhere('name', $name); |
203 | 203 | |
204 | - if (! $filter) { |
|
204 | + if (!$filter) { |
|
205 | 205 | abort(500, 'CRUD Filter "'.$name.'" not found. Please check the filter exists before you modify it.'); |
206 | 206 | } |
207 | 207 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | public function removeFilter($name) |
218 | 218 | { |
219 | - $strippedFiltersCollection = $this->filters()->reject(function ($filter) use ($name) { |
|
219 | + $strippedFiltersCollection = $this->filters()->reject(function($filter) use ($name) { |
|
220 | 220 | return $filter->name == $name; |
221 | 221 | }); |
222 | 222 | |
@@ -278,16 +278,16 @@ discard block |
||
278 | 278 | |
279 | 279 | public function checkOptionsIntegrity($options) |
280 | 280 | { |
281 | - if (! isset($options['name'])) { |
|
281 | + if (!isset($options['name'])) { |
|
282 | 282 | abort(500, 'Please make sure all your filters have names.'); |
283 | 283 | } |
284 | - if (! isset($options['type'])) { |
|
284 | + if (!isset($options['type'])) { |
|
285 | 285 | abort(500, 'Please make sure all your filters have types.'); |
286 | 286 | } |
287 | - if (! \View::exists('crud::filters.'.$options['type'])) { |
|
287 | + if (!\View::exists('crud::filters.'.$options['type'])) { |
|
288 | 288 | abort(500, 'No filter view named "'.$options['type'].'.blade.php" was found.'); |
289 | 289 | } |
290 | - if (! isset($options['label'])) { |
|
290 | + if (!isset($options['label'])) { |
|
291 | 291 | abort(500, 'Please make sure all your filters have labels.'); |
292 | 292 | } |
293 | 293 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | public function addColumn($column) |
64 | 64 | { |
65 | 65 | // if a string was passed, not an array, change it to an array |
66 | - if (! is_array($column)) { |
|
66 | + if (!is_array($column)) { |
|
67 | 67 | $column = ['name' => $column]; |
68 | 68 | } |
69 | 69 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $column_with_details = $this->addDefaultLabel($column); |
72 | 72 | |
73 | 73 | // make sure the column has a name |
74 | - if (! array_key_exists('name', $column_with_details)) { |
|
74 | + if (!array_key_exists('name', $column_with_details)) { |
|
75 | 75 | $column_with_details['name'] = 'anonymous_column_'.str_random(5); |
76 | 76 | } |
77 | 77 | |
@@ -79,27 +79,27 @@ discard block |
||
79 | 79 | $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']); |
80 | 80 | |
81 | 81 | // make sure the column has a type |
82 | - if (! array_key_exists('type', $column_with_details)) { |
|
82 | + if (!array_key_exists('type', $column_with_details)) { |
|
83 | 83 | $column_with_details['type'] = 'text'; |
84 | 84 | } |
85 | 85 | |
86 | 86 | // make sure the column has a key |
87 | - if (! array_key_exists('key', $column_with_details)) { |
|
87 | + if (!array_key_exists('key', $column_with_details)) { |
|
88 | 88 | $column_with_details['key'] = $column_with_details['name']; |
89 | 89 | } |
90 | 90 | |
91 | 91 | // make sure the column has a tableColumn boolean |
92 | - if (! array_key_exists('tableColumn', $column_with_details)) { |
|
92 | + if (!array_key_exists('tableColumn', $column_with_details)) { |
|
93 | 93 | $column_with_details['tableColumn'] = $columnExistsInDb ? true : false; |
94 | 94 | } |
95 | 95 | |
96 | 96 | // make sure the column has a orderable boolean |
97 | - if (! array_key_exists('orderable', $column_with_details)) { |
|
97 | + if (!array_key_exists('orderable', $column_with_details)) { |
|
98 | 98 | $column_with_details['orderable'] = $columnExistsInDb ? true : false; |
99 | 99 | } |
100 | 100 | |
101 | 101 | // make sure the column has a searchLogic |
102 | - if (! array_key_exists('searchLogic', $column_with_details)) { |
|
102 | + if (!array_key_exists('searchLogic', $column_with_details)) { |
|
103 | 103 | $column_with_details['searchLogic'] = $columnExistsInDb ? true : false; |
104 | 104 | } |
105 | 105 | |
@@ -108,14 +108,14 @@ discard block |
||
108 | 108 | |
109 | 109 | // make sure the column has a priority in terms of visibility |
110 | 110 | // if no priority has been defined, use the order in the array plus one |
111 | - if (! array_key_exists('priority', $column_with_details)) { |
|
111 | + if (!array_key_exists('priority', $column_with_details)) { |
|
112 | 112 | $position_in_columns_array = (int) array_search($column_with_details['key'], array_keys($this->columns())); |
113 | 113 | $columnsArray[$column_with_details['key']]['priority'] = $position_in_columns_array + 1; |
114 | 114 | } |
115 | 115 | |
116 | 116 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
117 | 117 | // defined in the main model |
118 | - if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) { |
|
118 | + if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) { |
|
119 | 119 | $columnsArray[$column_with_details['key']]['model'] = $this->getRelationModel($column_with_details['entity']); |
120 | 120 | } |
121 | 121 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function makeFirstColumn() |
166 | 166 | { |
167 | - if (! $this->columns()) { |
|
167 | + if (!$this->columns()) { |
|
168 | 168 | return false; |
169 | 169 | } |
170 | 170 | |
@@ -186,8 +186,7 @@ discard block |
||
186 | 186 | $columnsArray = $this->columns(); |
187 | 187 | |
188 | 188 | if (array_key_exists($targetColumnName, $columnsArray)) { |
189 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) : |
|
190 | - array_search($targetColumnName, array_keys($columnsArray)) + 1; |
|
189 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) : array_search($targetColumnName, array_keys($columnsArray)) + 1; |
|
191 | 190 | |
192 | 191 | $element = array_pop($columnsArray); |
193 | 192 | $beginningPart = array_slice($columnsArray, 0, $targetColumnPosition, true); |
@@ -225,7 +224,7 @@ discard block |
||
225 | 224 | */ |
226 | 225 | public function addDefaultLabel($array) |
227 | 226 | { |
228 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
227 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
229 | 228 | $array = array_merge(['label' => mb_ucfirst($this->makeLabel($array['name']))], $array); |
230 | 229 | |
231 | 230 | return $array; |
@@ -253,7 +252,7 @@ discard block |
||
253 | 252 | */ |
254 | 253 | public function removeColumns($columns) |
255 | 254 | { |
256 | - if (! empty($columns)) { |
|
255 | + if (!empty($columns)) { |
|
257 | 256 | foreach ($columns as $columnKey) { |
258 | 257 | $this->removeColumn($columnKey); |
259 | 258 | } |
@@ -331,7 +330,7 @@ discard block |
||
331 | 330 | { |
332 | 331 | $columns = $this->columns(); |
333 | 332 | |
334 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
333 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
335 | 334 | return $value == null; |
336 | 335 | })->toArray(); |
337 | 336 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | /** |
142 | 142 | * Move the most recently added column after the given target column. |
143 | 143 | * |
144 | - * @param string|array $targetColumn The target column name or array. |
|
144 | + * @param string $targetColumn The target column name or array. |
|
145 | 145 | */ |
146 | 146 | public function afterColumn($targetColumn) |
147 | 147 | { |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | /** |
162 | 162 | * Move this column to be first in the columns list. |
163 | - * @return bool|null |
|
163 | + * @return false|null |
|
164 | 164 | */ |
165 | 165 | public function makeFirstColumn() |
166 | 166 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | /** |
238 | 238 | * Remove a column from the CRUD panel by name. |
239 | 239 | * |
240 | - * @param string $column The column key. |
|
240 | + * @param string $columnKey The column key. |
|
241 | 241 | */ |
242 | 242 | public function removeColumn($columnKey) |
243 | 243 | { |
@@ -24,19 +24,19 @@ |
||
24 | 24 | if (isset($field['fake']) && $field['fake'] == true) { |
25 | 25 | // add it to the request in its appropriate variable - the one defined, if defined |
26 | 26 | if (isset($field['store_in'])) { |
27 | - if (! in_array($field['store_in'], $fakeFieldsColumnsArray, true)) { |
|
27 | + if (!in_array($field['store_in'], $fakeFieldsColumnsArray, true)) { |
|
28 | 28 | array_push($fakeFieldsColumnsArray, $field['store_in']); |
29 | 29 | } |
30 | 30 | } else { |
31 | 31 | //otherwise in the one defined in the $crud variable |
32 | - if (! in_array('extras', $fakeFieldsColumnsArray, true)) { |
|
32 | + if (!in_array('extras', $fakeFieldsColumnsArray, true)) { |
|
33 | 33 | array_push($fakeFieldsColumnsArray, 'extras'); |
34 | 34 | } |
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
38 | 38 | |
39 | - if (! count($fakeFieldsColumnsArray)) { |
|
39 | + if (!count($fakeFieldsColumnsArray)) { |
|
40 | 40 | $fakeFieldsColumnsArray = ['extras']; |
41 | 41 | } |
42 | 42 |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | */ |
13 | 13 | public function setFromDb() |
14 | 14 | { |
15 | - if (! $this->driverIsMongoDb()) { |
|
15 | + if (!$this->driverIsMongoDb()) { |
|
16 | 16 | $this->setDoctrineTypesMapping(); |
17 | 17 | $this->getDbColumnTypes(); |
18 | 18 | } |
19 | 19 | |
20 | - array_map(function ($field) { |
|
20 | + array_map(function($field) { |
|
21 | 21 | $new_field = [ |
22 | 22 | 'name' => $field, |
23 | 23 | 'label' => $this->makeLabel($field), |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | 'autoset' => true, |
30 | 30 | ]; |
31 | 31 | |
32 | - if (! isset($this->fields()[$field])) { |
|
32 | + if (!isset($this->fields()[$field])) { |
|
33 | 33 | $this->addField($new_field); |
34 | 34 | } |
35 | 35 | |
36 | - if (! in_array($field, $this->model->getHidden()) && ! isset($this->columns[$field])) { |
|
36 | + if (!in_array($field, $this->model->getHidden()) && !isset($this->columns[$field])) { |
|
37 | 37 | $this->addColumn([ |
38 | 38 | 'name' => $field, |
39 | 39 | 'label' => $this->makeLabel($field), |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $types = ['enum' => 'string']; |
164 | 164 | $platform = $this->getSchema()->getConnection()->getDoctrineConnection()->getDatabasePlatform(); |
165 | 165 | foreach ($types as $type_key => $type_value) { |
166 | - if (! $platform->hasDoctrineTypeMappingFor($type_key)) { |
|
166 | + if (!$platform->hasDoctrineTypeMappingFor($type_key)) { |
|
167 | 167 | $platform->registerDoctrineTypeMapping($type_key, $type_value); |
168 | 168 | } |
169 | 169 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | // Automatically-set columns should be both in the database, and in the $fillable variable on the Eloquent Model |
223 | 223 | $columns = $this->model->getConnection()->getSchemaBuilder()->getColumnListing($this->model->getTable()); |
224 | 224 | |
225 | - if (! empty($fillable)) { |
|
225 | + if (!empty($fillable)) { |
|
226 | 226 | $columns = array_intersect($columns, $fillable); |
227 | 227 | } |
228 | 228 | } |
@@ -43,7 +43,7 @@ |
||
43 | 43 | ], |
44 | 44 | |
45 | 45 | // CSS files that are loaded in all pages, using Laravel's mix() helper |
46 | - 'mix_styles' => [ // file_path => manifest_directory_path |
|
46 | + 'mix_styles' => [// file_path => manifest_directory_path |
|
47 | 47 | // 'css/app.css' => '', |
48 | 48 | ], |
49 | 49 |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\app\Models\Traits\SpatieTranslatable; |
4 | 4 | |
5 | -use Illuminate\Database\Eloquent\Model; |
|
6 | 5 | use Illuminate\Contracts\Events\Dispatcher; |
6 | +use Illuminate\Database\Eloquent\Model; |
|
7 | 7 | |
8 | 8 | class SluggableObserver extends \Cviebrock\EloquentSluggable\SluggableObserver |
9 | 9 | { |