We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 = 'crud::buttons.'.$view; |
@@ -119,7 +122,7 @@ discard block |
||
119 | 122 | } |
120 | 123 | |
121 | 124 | /** |
122 | - * @param array $names Button names |
|
125 | + * @param string[] $names Button names |
|
123 | 126 | * @param string|null $stack Optional stack name. |
124 | 127 | */ |
125 | 128 | public function removeButtons($names, $stack = null) |
@@ -136,6 +139,9 @@ discard block |
||
136 | 139 | $this->setOperationSetting('buttons', collect()); |
137 | 140 | } |
138 | 141 | |
142 | + /** |
|
143 | + * @param string $stack |
|
144 | + */ |
|
139 | 145 | public function removeAllButtonsFromStack($stack) |
140 | 146 | { |
141 | 147 | $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
@@ -158,6 +164,12 @@ discard block |
||
158 | 164 | public $type = 'view'; |
159 | 165 | public $content; |
160 | 166 | |
167 | + /** |
|
168 | + * @param string $stack |
|
169 | + * @param string $name |
|
170 | + * @param string $type |
|
171 | + * @param string $content |
|
172 | + */ |
|
161 | 173 | public function __construct($stack, $name, $type, $content) |
162 | 174 | { |
163 | 175 | $this->stack = $stack; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function removeButton($name, $stack = null) |
115 | 115 | { |
116 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
116 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
117 | 117 | return $stack == null ? $button->name == $name : ($button->stack == $stack) && ($button->name == $name); |
118 | 118 | })); |
119 | 119 | } |
@@ -138,14 +138,14 @@ discard block |
||
138 | 138 | |
139 | 139 | public function removeAllButtonsFromStack($stack) |
140 | 140 | { |
141 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($stack) { |
|
141 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($stack) { |
|
142 | 142 | return $button->stack == $stack; |
143 | 143 | })); |
144 | 144 | } |
145 | 145 | |
146 | 146 | public function removeButtonFromStack($name, $stack) |
147 | 147 | { |
148 | - $this->setOperationSetting('buttons', $this->buttons()->reject(function ($button) use ($name, $stack) { |
|
148 | + $this->setOperationSetting('buttons', $this->buttons()->reject(function($button) use ($name, $stack) { |
|
149 | 149 | return $button->name == $name && $button->stack == $stack; |
150 | 150 | })); |
151 | 151 | } |
@@ -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 | { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | /** |
240 | 240 | * Remove a column from the CRUD panel by name. |
241 | 241 | * |
242 | - * @param string $column The column key. |
|
242 | + * @param string $columnKey The column key. |
|
243 | 243 | */ |
244 | 244 | public function removeColumn($columnKey) |
245 | 245 | { |
@@ -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); |
@@ -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 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | * |
20 | 20 | * TODO: should this delete items with relations to it too? |
21 | 21 | * |
22 | - * @return bool True if the item was deleted. |
|
22 | + * @return string True if the item was deleted. |
|
23 | 23 | */ |
24 | 24 | public function delete($id) |
25 | 25 | { |
@@ -22,7 +22,6 @@ discard block |
||
22 | 22 | * Add a field to the create/update form or both. |
23 | 23 | * |
24 | 24 | * @param string|array $field The new field. |
25 | - * @param string $form The CRUD form. Can be 'create', 'update' or 'both'. Default is 'both'. |
|
26 | 25 | * |
27 | 26 | * @return self |
28 | 27 | */ |
@@ -70,7 +69,6 @@ discard block |
||
70 | 69 | * Add multiple fields to the create/update form or both. |
71 | 70 | * |
72 | 71 | * @param array $fields The new fields. |
73 | - * @param string $form The CRUD form. Can be 'create', 'update' or 'both'. Default is 'both'. |
|
74 | 72 | */ |
75 | 73 | public function addFields($fields) |
76 | 74 | { |
@@ -85,7 +83,6 @@ discard block |
||
85 | 83 | * Move the most recently added field after the given target field. |
86 | 84 | * |
87 | 85 | * @param string $targetFieldName The target field name. |
88 | - * @param string $form The CRUD form. Can be 'create', 'update' or 'both'. Default is 'both'. |
|
89 | 86 | */ |
90 | 87 | public function afterField($targetFieldName) |
91 | 88 | { |
@@ -98,7 +95,6 @@ discard block |
||
98 | 95 | * Move the most recently added field before the given target field. |
99 | 96 | * |
100 | 97 | * @param string $targetFieldName The target field name. |
101 | - * @param string $form The CRUD form. Can be 'create', 'update' or 'both'. Default is 'both'. |
|
102 | 98 | */ |
103 | 99 | public function beforeField($targetFieldName) |
104 | 100 | { |
@@ -141,7 +137,6 @@ discard block |
||
141 | 137 | * Remove a certain field from the create/update/both forms by its name. |
142 | 138 | * |
143 | 139 | * @param string $name Field name (as defined with the addField() procedure) |
144 | - * @param string $form update/create/both |
|
145 | 140 | */ |
146 | 141 | public function removeField($name) |
147 | 142 | { |
@@ -330,8 +325,6 @@ discard block |
||
330 | 325 | * Check if the create/update form has upload fields. |
331 | 326 | * Upload fields are the ones that have "upload" => true defined on them. |
332 | 327 | * |
333 | - * @param string $form create/update/both - defaults to 'both' |
|
334 | - * @param bool|int $id id of the entity - defaults to false |
|
335 | 328 | * |
336 | 329 | * @return bool |
337 | 330 | */ |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function afterField($targetFieldName) |
91 | 91 | { |
92 | - $this->transformFields(function ($fields) use ($targetFieldName) { |
|
92 | + $this->transformFields(function($fields) use ($targetFieldName) { |
|
93 | 93 | return $this->moveField($fields, $targetFieldName, false); |
94 | 94 | }); |
95 | 95 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function beforeField($targetFieldName) |
104 | 104 | { |
105 | - $this->transformFields(function ($fields) use ($targetFieldName) { |
|
105 | + $this->transformFields(function($fields) use ($targetFieldName) { |
|
106 | 106 | return $this->moveField($fields, $targetFieldName, true); |
107 | 107 | }); |
108 | 108 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function removeField($name) |
147 | 147 | { |
148 | - $this->transformFields(function ($fields) use ($name) { |
|
148 | + $this->transformFields(function($fields) use ($name) { |
|
149 | 149 | array_forget($fields, $name); |
150 | 150 | |
151 | 151 | return $fields; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | */ |
276 | 276 | public function orderFields($order) |
277 | 277 | { |
278 | - $this->transformFields(function ($fields) use ($order) { |
|
278 | + $this->transformFields(function($fields) use ($order) { |
|
279 | 279 | return $this->applyOrderToFields($fields, $order); |
280 | 280 | }); |
281 | 281 | } |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | public function hasUploadFields() |
339 | 339 | { |
340 | 340 | $fields = $this->getFields(); |
341 | - $upload_fields = array_where($fields, function ($value, $key) { |
|
341 | + $upload_fields = array_where($fields, function($value, $key) { |
|
342 | 342 | return isset($value['upload']) && $value['upload'] == true; |
343 | 343 | }); |
344 | 344 |
@@ -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 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | * Order results of the query in a custom way. |
66 | 66 | * |
67 | 67 | * @param array $column Column array with all attributes |
68 | - * @param string $column_direction ASC or DESC |
|
68 | + * @param string $columnDirection ASC or DESC |
|
69 | 69 | * |
70 | 70 | * @return \Illuminate\Database\Eloquent\Builder |
71 | 71 | */ |
@@ -35,6 +35,9 @@ |
||
35 | 35 | return !$this->tabsEnabled(); |
36 | 36 | } |
37 | 37 | |
38 | + /** |
|
39 | + * @param string $type |
|
40 | + */ |
|
38 | 41 | public function setTabsType($type) |
39 | 42 | { |
40 | 43 | $this->enableTabs(); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $all_fields = $this->getCurrentFields(); |
116 | 116 | |
117 | - $fields_without_a_tab = collect($all_fields)->filter(function ($value, $key) { |
|
117 | + $fields_without_a_tab = collect($all_fields)->filter(function($value, $key) { |
|
118 | 118 | return !isset($value['tab']); |
119 | 119 | }); |
120 | 120 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($this->tabExists($label)) { |
132 | 132 | $all_fields = $this->getCurrentFields(); |
133 | 133 | |
134 | - $fields_for_current_tab = collect($all_fields)->filter(function ($value, $key) use ($label) { |
|
134 | + $fields_for_current_tab = collect($all_fields)->filter(function($value, $key) use ($label) { |
|
135 | 135 | return isset($value['tab']) && $value['tab'] == $label; |
136 | 136 | }); |
137 | 137 | |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | $fields = $this->getCurrentFields(); |
151 | 151 | |
152 | 152 | $fields_with_tabs = collect($fields) |
153 | - ->filter(function ($value, $key) { |
|
153 | + ->filter(function($value, $key) { |
|
154 | 154 | return isset($value['tab']); |
155 | 155 | }) |
156 | - ->each(function ($value, $key) use (&$tabs) { |
|
156 | + ->each(function($value, $key) use (&$tabs) { |
|
157 | 157 | if (!in_array($value['tab'], $tabs)) { |
158 | 158 | $tabs[] = $value['tab']; |
159 | 159 | } |
@@ -107,7 +107,6 @@ |
||
107 | 107 | * for the given operation. |
108 | 108 | * |
109 | 109 | * @param string $inputKey Field or input name. |
110 | - * @param string $operation create / update |
|
111 | 110 | * |
112 | 111 | * @return bool |
113 | 112 | */ |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * Check if the application is running in normal conditions |
9 | 9 | * (production env, not in console, not in unit tests). |
10 | 10 | * |
11 | - * @return void |
|
11 | + * @return boolean |
|
12 | 12 | */ |
13 | 13 | private function runningInProduction() |
14 | 14 | { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param string $url URL to point the request at. |
86 | 86 | * @param array $payload The data you want sent to the URL. |
87 | 87 | * |
88 | - * @return void |
|
88 | + * @return boolean |
|
89 | 89 | */ |
90 | 90 | private function makeCurlRequest($method, $url, $payload) |
91 | 91 | { |