We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->crud->set('reorder.enabled', true); |
37 | 37 | $this->crud->allowAccess('reorder'); |
38 | 38 | |
39 | - $this->crud->operation('reorder', function () { |
|
39 | + $this->crud->operation('reorder', function() { |
|
40 | 40 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
41 | 41 | $this->crud->setOperationSetting('reorderColumnNames', [ |
42 | 42 | 'parent_id' => 'parent_id', |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ]); |
47 | 47 | }); |
48 | 48 | |
49 | - $this->crud->operation('list', function () { |
|
49 | + $this->crud->operation('list', function() { |
|
50 | 50 | $this->crud->addButton('top', 'reorder', 'view', 'crud::buttons.reorder'); |
51 | 51 | }); |
52 | 52 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | $this->crud->hasAccessOrFail('reorder'); |
64 | 64 | |
65 | - if (! $this->crud->isReorderEnabled()) { |
|
65 | + if (!$this->crud->isReorderEnabled()) { |
|
66 | 66 | abort(403, 'Reorder is disabled.'); |
67 | 67 | } |
68 | 68 |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | |
28 | 28 | @section('content') |
29 | 29 | <?php |
30 | -if(!function_exists('tree_element')) { |
|
30 | +if (!function_exists('tree_element')) { |
|
31 | 31 | function tree_element($entry, $key, $all_entries, $crud) { |
32 | 32 | $columns = $crud->getOperationSetting('reorderColumnNames'); |
33 | 33 | |
34 | - if (! isset($entry->tree_element_shown)) { |
|
34 | + if (!isset($entry->tree_element_shown)) { |
|
35 | 35 | // mark the element as shown |
36 | 36 | $all_entries[$key]->tree_element_shown = true; |
37 | 37 | $entry->tree_element_shown = true; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | <ol class="sortable mt-0 mb-0"> |
76 | 76 | <?php |
77 | 77 | $all_entries = collect($entries->all())->sortBy($columns['lft'])->keyBy($crud->getModel()->getKeyName()); |
78 | - $root_entries = $all_entries->filter(function ($item) use ($columns) { |
|
78 | + $root_entries = $all_entries->filter(function($item) use ($columns) { |
|
79 | 79 | return $item->{$columns['parent_id']} == 0; |
80 | 80 | }); |
81 | 81 | foreach ($root_entries as $key => $entry) { |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | $itemKeys = $this->model->query()->select($primaryKey)->get()->pluck($primaryKey); |
29 | 29 | |
30 | 30 | // filter the items that are not in the database and map the request |
31 | - $reorderItems = collect($request)->filter(function ($item) use ($itemKeys) { |
|
31 | + $reorderItems = collect($request)->filter(function($item) use ($itemKeys) { |
|
32 | 32 | return $item['item_id'] !== '' && $item['item_id'] !== null && $itemKeys->contains($item['item_id']); |
33 | - })->map(function ($item) use ($primaryKey, $columns) { |
|
33 | + })->map(function($item) use ($primaryKey, $columns) { |
|
34 | 34 | $item[$primaryKey] = $item['item_id']; |
35 | 35 | $item[$columns['parent_id']] = empty($item['parent_id']) ? null : $item['parent_id']; |
36 | 36 | $item[$columns['depth']] = empty($item['depth']) ? null : (int) $item['depth']; |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | |
60 | 60 | $sentIds = array_column($reorderItems, $primaryKey); |
61 | 61 | |
62 | - $itemKeys = $itemKeys->filter(function ($id) use ($sentIds) { |
|
62 | + $itemKeys = $itemKeys->filter(function($id) use ($sentIds) { |
|
63 | 63 | return in_array($id, $sentIds); |
64 | 64 | }); |
65 | 65 | |
66 | 66 | // wrap the queries in a transaction to avoid partial updates |
67 | - DB::connection($this->model->getConnectionName())->transaction(function () use ($reorderItems, $primaryKey, $itemKeys, $columns) { |
|
67 | + DB::connection($this->model->getConnectionName())->transaction(function() use ($reorderItems, $primaryKey, $itemKeys, $columns) { |
|
68 | 68 | // create a string of ?,?,?,? to use as bind placeholders for item keys |
69 | 69 | $reorderItemsBindString = implode(',', array_fill(0, count($reorderItems), '?')); |
70 | 70 |