We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -30,11 +30,11 @@ |
||
30 | 30 | $this->crud->allowAccess('show'); |
31 | 31 | $this->crud->setOperationSetting('setFromDb', true); |
32 | 32 | |
33 | - $this->crud->operation('show', function () { |
|
33 | + $this->crud->operation('show', function() { |
|
34 | 34 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
35 | 35 | }); |
36 | 36 | |
37 | - $this->crud->operation('list', function () { |
|
37 | + $this->crud->operation('list', function() { |
|
38 | 38 | $this->crud->addButton('line', 'show', 'view', 'crud::buttons.show', 'beginning'); |
39 | 39 | }); |
40 | 40 | } |
@@ -36,11 +36,11 @@ discard block |
||
36 | 36 | // allow access to the operation |
37 | 37 | $this->crud->allowAccess('revisions'); |
38 | 38 | |
39 | - $this->crud->operation('revisions', function () { |
|
39 | + $this->crud->operation('revisions', function() { |
|
40 | 40 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
41 | 41 | }); |
42 | 42 | |
43 | - $this->crud->operation(['list', 'show'], function () { |
|
43 | + $this->crud->operation(['list', 'show'], function() { |
|
44 | 44 | // add a button in the line stack |
45 | 45 | $this->crud->addButton('line', 'revisions', 'view', 'crud::buttons.revisions', 'end'); |
46 | 46 | }); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->crud->hasAccessOrFail('revisions'); |
89 | 89 | |
90 | 90 | $revisionId = \Request::input('revision_id', false); |
91 | - if (! $revisionId) { |
|
91 | + if (!$revisionId) { |
|
92 | 92 | abort(500, 'Can\'t restore revision without revision_id'); |
93 | 93 | } else { |
94 | 94 | $this->crud->restoreRevision($id, $revisionId); // do the update |
@@ -29,11 +29,11 @@ |
||
29 | 29 | { |
30 | 30 | $this->crud->allowAccess('bulkDelete'); |
31 | 31 | |
32 | - $this->crud->operation('bulkDelete', function () { |
|
32 | + $this->crud->operation('bulkDelete', function() { |
|
33 | 33 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
34 | 34 | }); |
35 | 35 | |
36 | - $this->crud->operation('list', function () { |
|
36 | + $this->crud->operation('list', function() { |
|
37 | 37 | $this->crud->enableBulkActions(); |
38 | 38 | $this->crud->addButton('bottom', 'bulk_delete', 'view', 'crud::buttons.bulk_delete'); |
39 | 39 | }); |
@@ -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,17 +71,17 @@ 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 | |
78 | 78 | // make sure the column has a type |
79 | - if (! array_key_exists('type', $column_with_details)) { |
|
79 | + if (!array_key_exists('type', $column_with_details)) { |
|
80 | 80 | $column_with_details['type'] = 'text'; |
81 | 81 | } |
82 | 82 | |
83 | 83 | // make sure the column has a key |
84 | - if (! array_key_exists('key', $column_with_details)) { |
|
84 | + if (!array_key_exists('key', $column_with_details)) { |
|
85 | 85 | $column_with_details['key'] = str_replace('.', '__', $column_with_details['name']); |
86 | 86 | } |
87 | 87 | |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | $columnExistsInDb = $this->hasColumn($this->model->getTable(), $column_with_details['name']); |
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 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function makeFirstColumn() |
167 | 167 | { |
168 | - if (! $this->columns()) { |
|
168 | + if (!$this->columns()) { |
|
169 | 169 | return false; |
170 | 170 | } |
171 | 171 | |
@@ -187,8 +187,7 @@ discard block |
||
187 | 187 | $columnsArray = $this->columns(); |
188 | 188 | |
189 | 189 | if (array_key_exists($targetColumnName, $columnsArray)) { |
190 | - $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) : |
|
191 | - array_search($targetColumnName, array_keys($columnsArray)) + 1; |
|
190 | + $targetColumnPosition = $before ? array_search($targetColumnName, array_keys($columnsArray)) : array_search($targetColumnName, array_keys($columnsArray)) + 1; |
|
192 | 191 | |
193 | 192 | $element = array_pop($columnsArray); |
194 | 193 | $beginningPart = array_slice($columnsArray, 0, $targetColumnPosition, true); |
@@ -227,7 +226,7 @@ discard block |
||
227 | 226 | */ |
228 | 227 | public function addDefaultLabel($array) |
229 | 228 | { |
230 | - if (! array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
229 | + if (!array_key_exists('label', (array) $array) && array_key_exists('name', (array) $array)) { |
|
231 | 230 | $array = array_merge(['label' => mb_ucfirst($this->makeLabel($array['name']))], $array); |
232 | 231 | |
233 | 232 | return $array; |
@@ -255,7 +254,7 @@ discard block |
||
255 | 254 | */ |
256 | 255 | public function removeColumns($columns) |
257 | 256 | { |
258 | - if (! empty($columns)) { |
|
257 | + if (!empty($columns)) { |
|
259 | 258 | foreach ($columns as $columnKey) { |
260 | 259 | $this->removeColumn($columnKey); |
261 | 260 | } |
@@ -334,7 +333,7 @@ discard block |
||
334 | 333 | { |
335 | 334 | $columns = $this->columns(); |
336 | 335 | |
337 | - return collect($columns)->pluck('entity')->reject(function ($value, $key) { |
|
336 | + return collect($columns)->pluck('entity')->reject(function($value, $key) { |
|
338 | 337 | return $value == null; |
339 | 338 | })->toArray(); |
340 | 339 | } |
@@ -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 | { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | /** |
162 | 162 | * Move this column to be first in the columns list. |
163 | 163 | * |
164 | - * @return bool|null |
|
164 | + * @return false|null |
|
165 | 165 | */ |
166 | 166 | public function makeFirstColumn() |
167 | 167 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * Convenience method to make sure all calls are made to a particular operation. |
58 | 58 | * |
59 | - * @param string|array $operation Operation name in string form |
|
59 | + * @param string|array $operations Operation name in string form |
|
60 | 60 | * @param bool|\Closure $closure Code that calls CrudPanel methods. |
61 | 61 | * |
62 | 62 | * @return void |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * Allc configurations are put inside that operation's namespace. |
72 | 72 | * Ex: show.configuration. |
73 | 73 | * |
74 | - * @param string|array $operation Operation name in string form |
|
74 | + * @param string|array $operations Operation name in string form |
|
75 | 75 | * @param bool|\Closure $closure Code that calls CrudPanel methods. |
76 | 76 | * |
77 | 77 | * @return void |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * This is called when an operation does setCurrentOperation(). |
94 | 94 | * |
95 | 95 | * |
96 | - * @param string|array $operations [description] |
|
96 | + * @param string $operations [description] |
|
97 | 97 | * |
98 | 98 | * @return void |
99 | 99 | */ |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | <?php |
4 | 4 | $max = isset($field['max']) && (int) $field['max'] > 0 ? $field['max'] : -1; |
5 | 5 | $min = isset($field['min']) && (int) $field['min'] > 0 ? $field['min'] : -1; |
6 | - $item_name = strtolower(isset($field['entity_singular']) && ! empty($field['entity_singular']) ? $field['entity_singular'] : $field['label']); |
|
6 | + $item_name = strtolower(isset($field['entity_singular']) && !empty($field['entity_singular']) ? $field['entity_singular'] : $field['label']); |
|
7 | 7 | |
8 | 8 | $items = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''; |
9 | 9 | |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | } else { |
16 | 16 | $items = '[]'; |
17 | 17 | } |
18 | - } elseif (is_string($items) && ! is_array(json_decode($items))) { |
|
18 | + } elseif (is_string($items) && !is_array(json_decode($items))) { |
|
19 | 19 | $items = '[]'; |
20 | 20 | } |
21 | 21 | |
22 | 22 | // make sure columns are defined |
23 | - if (! isset($field['columns'])) { |
|
23 | + if (!isset($field['columns'])) { |
|
24 | 24 | $field['columns'] = ['value' => 'Value']; |
25 | 25 | } |
26 | 26 | ?> |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | { |
42 | 42 | $this->crud->allowAccess('list'); |
43 | 43 | |
44 | - $this->crud->operation('list', function () { |
|
44 | + $this->crud->operation('list', function() { |
|
45 | 45 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
46 | 46 | }); |
47 | 47 | } |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | // if there was an order set, this will be the last one (after all others were applied) |
113 | 113 | $orderBy = $this->crud->query->getQuery()->orders; |
114 | 114 | $hasOrderByPrimaryKey = false; |
115 | - collect($orderBy)->each(function ($item, $key) use ($hasOrderByPrimaryKey) { |
|
116 | - if (! isset($item['column'])) { |
|
115 | + collect($orderBy)->each(function($item, $key) use ($hasOrderByPrimaryKey) { |
|
116 | + if (!isset($item['column'])) { |
|
117 | 117 | return false; |
118 | 118 | } |
119 | 119 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | }); |
126 | - if (! $hasOrderByPrimaryKey) { |
|
126 | + if (!$hasOrderByPrimaryKey) { |
|
127 | 127 | $this->crud->query->orderByDesc($this->crud->model->getKeyName()); |
128 | 128 | } |
129 | 129 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // call the setup function inside this closure to also have the request there |
29 | 29 | // this way, developers can use things stored in session (auth variables, etc) |
30 | - $this->middleware(function ($request, $next) { |
|
30 | + $this->middleware(function($request, $next) { |
|
31 | 31 | // make a new CrudPanel object, from the one stored in Laravel's service container |
32 | 32 | $this->crud = app()->make('crud'); |
33 | 33 | // ensure crud has the latest request |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\Tests\Unit\Http; |
4 | 4 | |
5 | -use Backpack\CRUD\app\Library\CrudPanel\CrudPanel; |
|
6 | 5 | use Backpack\CRUD\Tests\BaseTest; |
6 | +use Backpack\CRUD\app\Library\CrudPanel\CrudPanel; |
|
7 | 7 | |
8 | 8 | class CrudControllerTest extends BaseTest |
9 | 9 | { |
@@ -19,7 +19,7 @@ |
||
19 | 19 | $controller = '\Backpack\CRUD\Tests\Unit\Http\Controllers\UserCrudController'; |
20 | 20 | $app['router']->get('users/{id}/edit', "$controller@edit"); |
21 | 21 | $app['router']->put('users/{id}', "$controller@update"); |
22 | - $app->singleton('crud', function ($app) { |
|
22 | + $app->singleton('crud', function($app) { |
|
23 | 23 | return new CrudPanel($app); |
24 | 24 | }); |
25 | 25 | } |