@@ -138,7 +138,7 @@ |
||
138 | 138 | /** |
139 | 139 | * Fill fields to panel. |
140 | 140 | * |
141 | - * @param []Field $fields |
|
141 | + * @param Collection $fields |
|
142 | 142 | * |
143 | 143 | * @return $this |
144 | 144 | */ |
@@ -52,7 +52,7 @@ |
||
52 | 52 | /** |
53 | 53 | * Add a batch action. |
54 | 54 | * |
55 | - * @param $title |
|
55 | + * @param BatchDelete $title |
|
56 | 56 | * @param BatchAction|null $action |
57 | 57 | * |
58 | 58 | * @return $this |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function condition() |
57 | 57 | { |
58 | - return $this->queries->map(function ($query) { |
|
58 | + return $this->queries->map(function($query) { |
|
59 | 59 | return [$query['method'] => $query['arguments']]; |
60 | 60 | })->toArray(); |
61 | 61 | } |
@@ -288,7 +288,7 @@ |
||
288 | 288 | return ''; |
289 | 289 | } |
290 | 290 | |
291 | - return $tools->map(function ($tool) { |
|
291 | + return $tools->map(function($tool) { |
|
292 | 292 | if ($tool instanceof Renderable) { |
293 | 293 | return $tool->render(); |
294 | 294 | } |
@@ -275,7 +275,7 @@ |
||
275 | 275 | */ |
276 | 276 | protected function renderCustomTools($tools) |
277 | 277 | { |
278 | - return $tools->map(function ($tool) { |
|
278 | + return $tools->map(function($tool) { |
|
279 | 279 | if ($tool instanceof Renderable) { |
280 | 280 | return $tool->render(); |
281 | 281 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * |
280 | 280 | * @param $id |
281 | 281 | * |
282 | - * @return mixed |
|
282 | + * @return boolean |
|
283 | 283 | */ |
284 | 284 | public function destroy($id) |
285 | 285 | { |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | /** |
319 | 319 | * Store a new record. |
320 | 320 | * |
321 | - * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\Http\JsonResponse |
|
321 | + * @return Response |
|
322 | 322 | */ |
323 | 323 | public function store() |
324 | 324 | { |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * |
384 | 384 | * @param array $data |
385 | 385 | * |
386 | - * @return mixed |
|
386 | + * @return Response|null |
|
387 | 387 | */ |
388 | 388 | protected function prepare($data = []) |
389 | 389 | { |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | /** |
562 | 562 | * Get RedirectResponse after update. |
563 | 563 | * |
564 | - * @param mixed $key |
|
564 | + * @param integer $key |
|
565 | 565 | * @return \Illuminate\Http\RedirectResponse |
566 | 566 | */ |
567 | 567 | protected function redirectAfterUpdate($key) |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | /** |
892 | 892 | * Set saved callback. |
893 | 893 | * |
894 | - * @param callable $callback |
|
894 | + * @param Closure $callback |
|
895 | 895 | * |
896 | 896 | * @return void |
897 | 897 | */ |
@@ -306,9 +306,9 @@ discard block |
||
306 | 306 | $data = $this->model->with($this->getRelations()) |
307 | 307 | ->findOrFail($id)->toArray(); |
308 | 308 | |
309 | - $this->builder->fields()->filter(function ($field) { |
|
309 | + $this->builder->fields()->filter(function($field) { |
|
310 | 310 | return $field instanceof Field\File; |
311 | - })->each(function (File $file) use ($data) { |
|
311 | + })->each(function(File $file) use ($data) { |
|
312 | 312 | $file->setOriginal($data); |
313 | 313 | |
314 | 314 | $file->destroy(); |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | return $response; |
334 | 334 | } |
335 | 335 | |
336 | - DB::transaction(function () { |
|
336 | + DB::transaction(function() { |
|
337 | 337 | $inserts = $this->prepareInsert($this->updates); |
338 | 338 | |
339 | 339 | foreach ($inserts as $column => $value) { |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | return $response; |
521 | 521 | } |
522 | 522 | |
523 | - DB::transaction(function () { |
|
523 | + DB::transaction(function() { |
|
524 | 524 | $updates = $this->prepareUpdate($this->updates); |
525 | 525 | |
526 | 526 | foreach ($updates as $column => $value) { |
@@ -582,10 +582,10 @@ discard block |
||
582 | 582 | { |
583 | 583 | if (request('after-save') == 1) { |
584 | 584 | // continue editing |
585 | - $url = rtrim($resourcesPath, '/') . "/{$key}/edit"; |
|
585 | + $url = rtrim($resourcesPath, '/')."/{$key}/edit"; |
|
586 | 586 | } elseif (request('after-save') == 2) { |
587 | 587 | // view resource |
588 | - $url = rtrim($resourcesPath, '/') . "/{$key}"; |
|
588 | + $url = rtrim($resourcesPath, '/')."/{$key}"; |
|
589 | 589 | } else { |
590 | 590 | $url = request(Builder::PREVIOUS_URL_KEY) ?: $resourcesPath; |
591 | 591 | } |
@@ -949,7 +949,7 @@ discard block |
||
949 | 949 | protected function getFieldByColumn($column) |
950 | 950 | { |
951 | 951 | return $this->builder->fields()->first( |
952 | - function (Field $field) use ($column) { |
|
952 | + function(Field $field) use ($column) { |
|
953 | 953 | if (is_array($field->column())) { |
954 | 954 | return in_array($column, $field->column()); |
955 | 955 | } |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | |
971 | 971 | $values = $this->model->toArray(); |
972 | 972 | |
973 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
973 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
974 | 974 | $field->setOriginal($values); |
975 | 975 | }); |
976 | 976 | } |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | |
993 | 993 | $data = $this->model->toArray(); |
994 | 994 | |
995 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
995 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
996 | 996 | if (!in_array($field->column(), $this->ignored)) { |
997 | 997 | $field->fill($data); |
998 | 998 | } |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | */ |
1114 | 1114 | public function setWidth($fieldWidth = 8, $labelWidth = 2) |
1115 | 1115 | { |
1116 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1116 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1117 | 1117 | /* @var Field $field */ |
1118 | 1118 | $field->setWidth($fieldWidth, $labelWidth); |
1119 | 1119 | }); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | { |
208 | 208 | $inputs = array_dot(Input::all()); |
209 | 209 | |
210 | - $inputs = array_filter($inputs, function ($input) { |
|
210 | + $inputs = array_filter($inputs, function($input) { |
|
211 | 211 | return $input !== '' && !is_null($input); |
212 | 212 | }); |
213 | 213 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $conditions[] = $filter->condition($params); |
232 | 232 | } |
233 | 233 | |
234 | - return tap(array_filter($conditions), function ($conditions) { |
|
234 | + return tap(array_filter($conditions), function($conditions) { |
|
235 | 235 | if (!empty($conditions)) { |
236 | 236 | $this->expand(); |
237 | 237 | } |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | return $inputs; |
250 | 250 | } |
251 | 251 | |
252 | - $inputs = collect($inputs)->filter(function ($input, $key) { |
|
252 | + $inputs = collect($inputs)->filter(function($input, $key) { |
|
253 | 253 | return starts_with($key, "{$this->name}_"); |
254 | - })->mapWithKeys(function ($val, $key) { |
|
254 | + })->mapWithKeys(function($val, $key) { |
|
255 | 255 | $key = str_replace("{$this->name}_", '', $key); |
256 | 256 | |
257 | 257 | return [$key => $val]; |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | */ |
302 | 302 | public function scope($key, $label = '') |
303 | 303 | { |
304 | - return tap(new Scope($key, $label), function (Scope $scope) { |
|
304 | + return tap(new Scope($key, $label), function(Scope $scope) { |
|
305 | 305 | return $this->scopes->push($scope); |
306 | 306 | }); |
307 | 307 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | { |
326 | 326 | $key = request(Scope::QUERY_NAME); |
327 | 327 | |
328 | - return $this->scopes->first(function ($scope) use ($key) { |
|
328 | + return $this->scopes->first(function($scope) use ($key) { |
|
329 | 329 | return $scope->key == $key; |
330 | 330 | }); |
331 | 331 | } |