We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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) { |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * Check if the application is running in normal conditions |
11 | 11 | * (production env, not in console, not in unit tests). |
12 | 12 | * |
13 | - * @return void |
|
13 | + * @return boolean |
|
14 | 14 | */ |
15 | 15 | private function runningInProduction() |
16 | 16 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param string $method HTTP Method to use for the request. |
87 | 87 | * @param string $url URL to point the request at. |
88 | 88 | * @param array $payload The data you want sent to the URL. |
89 | - * @return void |
|
89 | + * @return boolean |
|
90 | 90 | */ |
91 | 91 | private function makeCurlRequest($method, $url, $payload) |
92 | 92 | { |
@@ -38,7 +38,7 @@ |
||
38 | 38 | private function sendUsageStats() |
39 | 39 | { |
40 | 40 | // only send usage stats in production |
41 | - if (! $this->runningInProduction()) { |
|
41 | + if (!$this->runningInProduction()) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | <span> |
3 | 3 | <?php |
4 | 4 | $array = $entry->{$column['name']}; |
5 | - $suffix = isset($column['suffix'])?$column['suffix']:'items'; |
|
5 | + $suffix = isset($column['suffix']) ? $column['suffix'] : 'items'; |
|
6 | 6 | |
7 | 7 | // the value should be an array wether or not attribute casting is used |
8 | 8 | if (!is_array($array)) { |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace Backpack\CRUD\Tests\Unit\CrudPanel; |
4 | 4 | |
5 | -use Illuminate\Support\Facades\DB; |
|
6 | 5 | use Backpack\CRUD\Tests\Unit\Models\Article; |
6 | +use Illuminate\Support\Facades\DB; |
|
7 | 7 | |
8 | 8 | class CrudPanelTabsTest extends BaseDBCrudPanelTest |
9 | 9 | { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | $button = $this->buttons()->firstWhere('name', $name); |
109 | 109 | |
110 | - if (! $button) { |
|
110 | + if (!$button) { |
|
111 | 111 | abort(500, 'CRUD Button "'.$name.'" not found. Please check the button exists before you modify it.'); |
112 | 112 | } |
113 | 113 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function removeButton($name, $stack = null) |
130 | 130 | { |
131 | - $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) { |
|
131 | + $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) { |
|
132 | 132 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
133 | 133 | }); |
134 | 134 | } |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | |
141 | 141 | public function removeAllButtonsFromStack($stack) |
142 | 142 | { |
143 | - $this->buttons = $this->buttons->reject(function ($button) use ($stack) { |
|
143 | + $this->buttons = $this->buttons->reject(function($button) use ($stack) { |
|
144 | 144 | return $button->stack == $stack; |
145 | 145 | }); |
146 | 146 | } |
147 | 147 | |
148 | 148 | public function removeButtonFromStack($name, $stack) |
149 | 149 | { |
150 | - $this->buttons = $this->buttons->reject(function ($button) use ($name, $stack) { |
|
150 | + $this->buttons = $this->buttons->reject(function($button) use ($name, $stack) { |
|
151 | 151 | return $button->name == $name && $button->stack == $stack; |
152 | 152 | }); |
153 | 153 | } |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | $this->addButton($stack, $name, 'model_function', $model_function_name, $position); |
63 | 63 | } |
64 | 64 | |
65 | + /** |
|
66 | + * @param string $view |
|
67 | + */ |
|
65 | 68 | public function addButtonFromView($stack, $name, $view, $position = false) |
66 | 69 | { |
67 | 70 | $view = 'vendor.backpack.crud.buttons.'.$view; |
@@ -98,7 +101,7 @@ discard block |
||
98 | 101 | * @param string $name The button name. |
99 | 102 | * @param array $modifications The attributes and their new values. |
100 | 103 | * |
101 | - * @return CrudButton The button that has suffered the changes, for daisychaining methods. |
|
104 | + * @return Collection The button that has suffered the changes, for daisychaining methods. |
|
102 | 105 | */ |
103 | 106 | public function modifyButton($name, $modifications = null) |
104 | 107 | { |
@@ -138,6 +141,9 @@ discard block |
||
138 | 141 | $this->buttons = collect([]); |
139 | 142 | } |
140 | 143 | |
144 | + /** |
|
145 | + * @param string $stack |
|
146 | + */ |
|
141 | 147 | public function removeAllButtonsFromStack($stack) |
142 | 148 | { |
143 | 149 | $this->buttons = $this->buttons->reject(function ($button) use ($stack) { |
@@ -160,6 +166,12 @@ discard block |
||
160 | 166 | public $type = 'view'; |
161 | 167 | public $content; |
162 | 168 | |
169 | + /** |
|
170 | + * @param string $stack |
|
171 | + * @param string $name |
|
172 | + * @param string $type |
|
173 | + * @param string $content |
|
174 | + */ |
|
163 | 175 | public function __construct($stack, $name, $type, $content) |
164 | 176 | { |
165 | 177 | $this->stack = $stack; |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function tabsDisabled() |
37 | 37 | { |
38 | - return ! $this->tabsEnabled; |
|
38 | + return !$this->tabsEnabled; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function setTabsType($type) |
@@ -116,8 +116,8 @@ discard block |
||
116 | 116 | { |
117 | 117 | $all_fields = $this->getCurrentFields(); |
118 | 118 | |
119 | - $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) { |
|
120 | - return ! isset($value['tab']); |
|
119 | + $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) { |
|
120 | + return !isset($value['tab']); |
|
121 | 121 | }); |
122 | 122 | |
123 | 123 | return $fields_without_a_tab; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | if ($this->tabExists($label)) { |
134 | 134 | $all_fields = $this->getCurrentFields(); |
135 | 135 | |
136 | - $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) { |
|
136 | + $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) { |
|
137 | 137 | return isset($value['tab']) && $value['tab'] == $label; |
138 | 138 | }); |
139 | 139 | |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | $fields = $this->getCurrentFields(); |
153 | 153 | |
154 | 154 | $fields_with_tabs = collect($fields) |
155 | - ->filter(function ($value, $key) { |
|
155 | + ->filter(function($value, $key) { |
|
156 | 156 | return isset($value['tab']); |
157 | 157 | }) |
158 | - ->each(function ($value, $key) use (&$tabs) { |
|
159 | - if (! in_array($value['tab'], $tabs)) { |
|
158 | + ->each(function($value, $key) use (&$tabs) { |
|
159 | + if (!in_array($value['tab'], $tabs)) { |
|
160 | 160 | $tabs[] = $value['tab']; |
161 | 161 | } |
162 | 162 | }); |