We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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%" |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | // if attribute casting is used, convert to JSON |
7 | 7 | if (is_array($value)) { |
8 | - $value = json_encode((object)$value); |
|
8 | + $value = json_encode((object) $value); |
|
9 | 9 | } elseif (is_object($value)) { |
10 | 10 | $value = json_encode($value); |
11 | 11 | } else { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('square_brackets_to_dots')) { |
|
3 | +if (!function_exists('square_brackets_to_dots')) { |
|
4 | 4 | /** |
5 | 5 | * Turns a string from bracket-type array to dot-notation array. |
6 | 6 | * Ex: array[0][property] turns into array.0.property. |
@@ -71,10 +71,10 @@ |
||
71 | 71 | <ol class="sortable"> |
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 | - foreach ($root_entries as $key => $entry){ |
|
77 | + foreach ($root_entries as $key => $entry) { |
|
78 | 78 | $root_entries[$key] = tree_element($entry, $key, $all_entries, $crud); |
79 | 79 | } |
80 | 80 | ?> |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | public function addColumn($column) |
69 | 69 | { |
70 | 70 | // if a string was passed, not an array, change it to an array |
71 | - if (! is_array($column)) { |
|
71 | + if (!is_array($column)) { |
|
72 | 72 | $column = ['name' => $column]; |
73 | 73 | } |
74 | 74 | |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $column_with_details = $this->addDefaultLabel($column); |
77 | 77 | |
78 | 78 | // make sure the column has a name |
79 | - if (! array_key_exists('name', $column_with_details)) { |
|
79 | + if (!array_key_exists('name', $column_with_details)) { |
|
80 | 80 | $column_with_details['name'] = 'anonymous_column_'.str_random(5); |
81 | 81 | } |
82 | 82 | |
@@ -84,27 +84,27 @@ discard block |
||
84 | 84 | $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']); |
85 | 85 | |
86 | 86 | // make sure the column has a type |
87 | - if (! array_key_exists('type', $column_with_details)) { |
|
87 | + if (!array_key_exists('type', $column_with_details)) { |
|
88 | 88 | $column_with_details['type'] = 'text'; |
89 | 89 | } |
90 | 90 | |
91 | 91 | // make sure the column has a key |
92 | - if (! array_key_exists('key', $column_with_details)) { |
|
92 | + if (!array_key_exists('key', $column_with_details)) { |
|
93 | 93 | $column_with_details['key'] = $column_with_details['name']; |
94 | 94 | } |
95 | 95 | |
96 | 96 | // make sure the column has a tableColumn boolean |
97 | - if (! array_key_exists('tableColumn', $column_with_details)) { |
|
97 | + if (!array_key_exists('tableColumn', $column_with_details)) { |
|
98 | 98 | $column_with_details['tableColumn'] = $columnExistsInDb ? true : false; |
99 | 99 | } |
100 | 100 | |
101 | 101 | // make sure the column has a orderable boolean |
102 | - if (! array_key_exists('orderable', $column_with_details)) { |
|
102 | + if (!array_key_exists('orderable', $column_with_details)) { |
|
103 | 103 | $column_with_details['orderable'] = $columnExistsInDb ? true : false; |
104 | 104 | } |
105 | 105 | |
106 | 106 | // make sure the column has a searchLogic |
107 | - if (! array_key_exists('searchLogic', $column_with_details)) { |
|
107 | + if (!array_key_exists('searchLogic', $column_with_details)) { |
|
108 | 108 | $column_with_details['searchLogic'] = $columnExistsInDb ? true : false; |
109 | 109 | } |
110 | 110 | |
@@ -112,14 +112,14 @@ discard block |
||
112 | 112 | |
113 | 113 | // make sure the column has a priority in terms of visibility |
114 | 114 | // if no priority has been defined, use the order in the array plus one |
115 | - if (! array_key_exists('priority', $column_with_details)) { |
|
115 | + if (!array_key_exists('priority', $column_with_details)) { |
|
116 | 116 | $position_in_columns_array = (int) array_search($column_with_details['key'], array_keys($this->columns)); |
117 | 117 | $this->columns[$column_with_details['key']]['priority'] = $position_in_columns_array + 1; |
118 | 118 | } |
119 | 119 | |
120 | 120 | // if this is a relation type field and no corresponding model was specified, get it from the relation method |
121 | 121 | // defined in the main model |
122 | - if (isset($column_with_details['entity']) && ! isset($column_with_details['model'])) { |
|
122 | + if (isset($column_with_details['entity']) && !isset($column_with_details['model'])) { |
|
123 | 123 | $column_with_details['model'] = $this->getRelationModel($column_with_details['entity']); |
124 | 124 | } |
125 | 125 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | */ |
167 | 167 | public function makeFirstColumn() |
168 | 168 | { |
169 | - if (! $this->columns) { |
|
169 | + if (!$this->columns) { |
|
170 | 170 | return false; |
171 | 171 | } |
172 | 172 | |
@@ -187,8 +187,7 @@ discard block |
||
187 | 187 | $targetColumnName = is_array($targetColumn) ? $targetColumn['name'] : $targetColumn; |
188 | 188 | |
189 | 189 | if (array_key_exists($targetColumnName, $this->columns)) { |
190 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : |
|
191 | - array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
190 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($this->columns)) : array_search($targetColumnName, array_keys($this->columns)) + 1; |
|
192 | 191 | |
193 | 192 | $element = array_pop($this->columns); |
194 | 193 | $beginningPart = array_slice($this->columns, 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; |
@@ -251,7 +250,7 @@ discard block |
||
251 | 250 | */ |
252 | 251 | public function removeColumns($columns) |
253 | 252 | { |
254 | - if (! empty($columns)) { |
|
253 | + if (!empty($columns)) { |
|
255 | 254 | foreach ($columns as $columnName) { |
256 | 255 | $this->removeColumn($columnName); |
257 | 256 | } |
@@ -273,8 +272,8 @@ discard block |
||
273 | 272 | */ |
274 | 273 | public function remove($entity, $fields) |
275 | 274 | { |
276 | - return array_values(array_filter($this->{$entity}, function ($field) use ($fields) { |
|
277 | - return ! in_array($field['name'], (array) $fields); |
|
275 | + return array_values(array_filter($this->{$entity}, function($field) use ($fields) { |
|
276 | + return !in_array($field['name'], (array) $fields); |
|
278 | 277 | })); |
279 | 278 | } |
280 | 279 | |
@@ -331,7 +330,7 @@ discard block |
||
331 | 330 | { |
332 | 331 | $columns = $this->getColumns(); |
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 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | */ |
69 | 69 | public function customOrderBy($column, $columnDirection = 'asc') |
70 | 70 | { |
71 | - if (! isset($column['orderLogic'])) { |
|
71 | + if (!isset($column['orderLogic'])) { |
|
72 | 72 | return $this->query; |
73 | 73 | } |
74 | 74 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | $this->crud->hasAccessOrFail('reorder'); |
17 | 17 | $this->crud->setOperation('reorder'); |
18 | 18 | |
19 | - if (! $this->crud->isReorderEnabled()) { |
|
19 | + if (!$this->crud->isReorderEnabled()) { |
|
20 | 20 | abort(403, 'Reorder is disabled.'); |
21 | 21 | } |
22 | 22 |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $this->crud->setOperation('revisions'); |
47 | 47 | |
48 | 48 | $revisionId = \Request::input('revision_id', false); |
49 | - if (! $revisionId) { |
|
49 | + if (!$revisionId) { |
|
50 | 50 | abort(500, 'Can\'t restore revision without revision_id'); |
51 | 51 | } else { |
52 | 52 | $this->crud->restoreRevision($id, $revisionId); // do the update |
@@ -5,7 +5,7 @@ |
||
5 | 5 | |
6 | 6 | <span> |
7 | 7 | <?php |
8 | - $suffix = isset($column['suffix'])?$column['suffix']:'items'; |
|
8 | + $suffix = isset($column['suffix']) ? $column['suffix'] : 'items'; |
|
9 | 9 | |
10 | 10 | // the value should be an array wether or not attribute casting is used |
11 | 11 | if (!is_array($array)) { |