@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * Set grid action callback. |
26 | 26 | * |
27 | - * @param Closure|string $actions |
|
27 | + * @param Closure $actions |
|
28 | 28 | * |
29 | 29 | * @return $this |
30 | 30 | */ |
@@ -88,7 +88,7 @@ |
||
88 | 88 | */ |
89 | 89 | public function batchActions(Closure $closure) |
90 | 90 | { |
91 | - $this->tools(function (Grid\Tools $tools) use ($closure) { |
|
91 | + $this->tools(function(Grid\Tools $tools) use ($closure) { |
|
92 | 92 | $tools->batch($closure); |
93 | 93 | }); |
94 | 94 |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | $column = new Column($column, $label); |
358 | 358 | $column->setGrid($this); |
359 | 359 | |
360 | - return tap($column, function ($value) { |
|
360 | + return tap($column, function($value) { |
|
361 | 361 | $this->columns->push($value); |
362 | 362 | }); |
363 | 363 | } |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | $column = new Column($column, $label); |
422 | 422 | $column->setGrid($this); |
423 | 423 | |
424 | - return tap($column, function ($value) { |
|
424 | + return tap($column, function($value) { |
|
425 | 425 | $this->columns->prepend($value); |
426 | 426 | }); |
427 | 427 | } |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | $data = $collection->toArray(); |
556 | 556 | |
557 | - $this->columns->map(function (Column $column) use (&$data) { |
|
557 | + $this->columns->map(function(Column $column) use (&$data) { |
|
558 | 558 | $data = $column->fill($data); |
559 | 559 | |
560 | 560 | $this->columnNames[] = $column->getName(); |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | */ |
575 | 575 | protected function buildRows(array $data) |
576 | 576 | { |
577 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
577 | + $this->rows = collect($data)->map(function($model, $number) { |
|
578 | 578 | return new Row($number, $model, $this->keyName); |
579 | 579 | }); |
580 | 580 |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * Get or set option for grid. |
270 | 270 | * |
271 | 271 | * @param string $key |
272 | - * @param mixed $value |
|
272 | + * @param boolean $value |
|
273 | 273 | * |
274 | 274 | * @return $this|mixed |
275 | 275 | */ |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | /** |
455 | 455 | * Get the grid paginator. |
456 | 456 | * |
457 | - * @return mixed |
|
457 | + * @return Tools\Paginator |
|
458 | 458 | */ |
459 | 459 | public function paginator() |
460 | 460 | { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | } |
533 | 533 | |
534 | 534 | /** |
535 | - * @return array|Collection|mixed |
|
535 | + * @return Collection |
|
536 | 536 | */ |
537 | 537 | protected function applyQuery() |
538 | 538 | { |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | /** |
830 | 830 | * Dynamically add columns to the grid view. |
831 | 831 | * |
832 | - * @param $method |
|
832 | + * @param string $method |
|
833 | 833 | * @param $arguments |
834 | 834 | * |
835 | 835 | * @return Column |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | /** |
219 | 219 | * Set model for column. |
220 | 220 | * |
221 | - * @param $model |
|
221 | + * @param BaseModel $model |
|
222 | 222 | */ |
223 | 223 | public function setModel($model) |
224 | 224 | { |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | /** |
348 | 348 | * Get name of this column. |
349 | 349 | * |
350 | - * @return mixed |
|
350 | + * @return string |
|
351 | 351 | */ |
352 | 352 | public function getName() |
353 | 353 | { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | /** |
386 | 386 | * Get label of the column. |
387 | 387 | * |
388 | - * @return mixed |
|
388 | + * @return string |
|
389 | 389 | */ |
390 | 390 | public function getLabel() |
391 | 391 | { |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $name = $this->getName(); |
487 | 487 | $query = request()->query(); |
488 | 488 | |
489 | - $this->prefix(function ($_, $original) use ($name, $query) { |
|
489 | + $this->prefix(function($_, $original) use ($name, $query) { |
|
490 | 490 | Arr::set($query, $name, $original); |
491 | 491 | |
492 | 492 | $url = request()->fullUrlWithQuery($query); |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | |
540 | 540 | $column = $this; |
541 | 541 | |
542 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
542 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
543 | 543 | /** @var AbstractDisplayer $displayer */ |
544 | 544 | $displayer = new $abstract($value, $grid, $column, $this); |
545 | 545 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | */ |
558 | 558 | public function using(array $values, $default = null) |
559 | 559 | { |
560 | - return $this->display(function ($value) use ($values, $default) { |
|
560 | + return $this->display(function($value) use ($values, $default) { |
|
561 | 561 | if (is_null($value)) { |
562 | 562 | return $default; |
563 | 563 | } |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | */ |
576 | 576 | public function replace(array $replacements) |
577 | 577 | { |
578 | - return $this->display(function ($value) use ($replacements) { |
|
578 | + return $this->display(function($value) use ($replacements) { |
|
579 | 579 | if (isset($replacements[$value])) { |
580 | 580 | return $replacements[$value]; |
581 | 581 | } |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | */ |
594 | 594 | public function view($view) |
595 | 595 | { |
596 | - return $this->display(function ($value) use ($view) { |
|
596 | + return $this->display(function($value) use ($view) { |
|
597 | 597 | $model = $this; |
598 | 598 | |
599 | 599 | return view($view, compact('model', 'value'))->render(); |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | */ |
634 | 634 | public function filesize() |
635 | 635 | { |
636 | - return $this->display(function ($value) { |
|
636 | + return $this->display(function($value) { |
|
637 | 637 | return file_size($value); |
638 | 638 | }); |
639 | 639 | } |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | */ |
648 | 648 | public function gravatar($size = 30) |
649 | 649 | { |
650 | - return $this->display(function ($value) use ($size) { |
|
650 | + return $this->display(function($value) use ($size) { |
|
651 | 651 | $src = sprintf( |
652 | 652 | 'https://www.gravatar.com/avatar/%s?s=%d', |
653 | 653 | md5(strtolower($value)), |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | */ |
669 | 669 | public function loading($values = [], $others = []) |
670 | 670 | { |
671 | - return $this->display(function ($value) use ($values, $others) { |
|
671 | + return $this->display(function($value) use ($values, $others) { |
|
672 | 672 | $values = (array) $values; |
673 | 673 | |
674 | 674 | if (in_array($value, $values)) { |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | */ |
690 | 690 | public function icon(array $setting, $default = '') |
691 | 691 | { |
692 | - return $this->display(function ($value) use ($setting, $default) { |
|
692 | + return $this->display(function($value) use ($setting, $default) { |
|
693 | 693 | $fa = ''; |
694 | 694 | |
695 | 695 | if (isset($setting[$value])) { |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | Carbon::setLocale($locale); |
716 | 716 | } |
717 | 717 | |
718 | - return $this->display(function ($value) { |
|
718 | + return $this->display(function($value) { |
|
719 | 719 | return Carbon::parse($value)->diffForHumans(); |
720 | 720 | }); |
721 | 721 | } |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | */ |
730 | 730 | public function date($format) |
731 | 731 | { |
732 | - return $this->display(function ($value) use ($format) { |
|
732 | + return $this->display(function($value) use ($format) { |
|
733 | 733 | return date($format, strtotime($value)); |
734 | 734 | }); |
735 | 735 | } |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | */ |
745 | 745 | public function bool(array $map = [], $default = false) |
746 | 746 | { |
747 | - return $this->display(function ($value) use ($map, $default) { |
|
747 | + return $this->display(function($value) use ($map, $default) { |
|
748 | 748 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
749 | 749 | |
750 | 750 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | |
767 | 767 | $grid = $this->grid; |
768 | 768 | |
769 | - return $this->display(function ($_, $column) use ($action, $grid) { |
|
769 | + return $this->display(function($_, $column) use ($action, $grid) { |
|
770 | 770 | /** @var RowAction $action */ |
771 | 771 | $action = new $action(); |
772 | 772 | |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | */ |
789 | 789 | public function dot($options = [], $default = '') |
790 | 790 | { |
791 | - return $this->prefix(function ($_, $original) use ($options, $default) { |
|
791 | + return $this->prefix(function($_, $original) use ($options, $default) { |
|
792 | 792 | if (is_null($original)) { |
793 | 793 | $style = $default; |
794 | 794 | } else { |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $grid = $this->grid; |
916 | 916 | $column = $this; |
917 | 917 | |
918 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
918 | + $this->display(function($value) use ($grid, $column, $class) { |
|
919 | 919 | /** @var AbstractDisplayer $definition */ |
920 | 920 | $definition = new $class($value, $grid, $column, $this); |
921 | 921 | |
@@ -933,7 +933,7 @@ discard block |
||
933 | 933 | protected function htmlEntityEncode($item) |
934 | 934 | { |
935 | 935 | if (is_array($item)) { |
936 | - array_walk_recursive($item, function (&$value) { |
|
936 | + array_walk_recursive($item, function(&$value) { |
|
937 | 937 | $value = htmlentities($value); |
938 | 938 | }); |
939 | 939 | } else { |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | */ |
971 | 971 | protected function callSupportDisplayer($abstract, $arguments) |
972 | 972 | { |
973 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
973 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
974 | 974 | if (is_array($value) || $value instanceof Arrayable) { |
975 | 975 | return call_user_func_array([collect($value), $abstract], $arguments); |
976 | 976 | } |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | protected function callBuiltinDisplayer($abstract, $arguments) |
995 | 995 | { |
996 | 996 | if ($abstract instanceof Closure) { |
997 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
997 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
998 | 998 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
999 | 999 | }); |
1000 | 1000 | } |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | $grid = $this->grid; |
1004 | 1004 | $column = $this; |
1005 | 1005 | |
1006 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
1006 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
1007 | 1007 | /** @var AbstractDisplayer $displayer */ |
1008 | 1008 | $displayer = new $abstract($value, $grid, $column, $this); |
1009 | 1009 |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | Admin::script($this->script()); |
69 | 69 | |
70 | - $options = $this->getOptions()->map(function ($option) { |
|
70 | + $options = $this->getOptions()->map(function($option) { |
|
71 | 71 | $selected = ($option == $this->perPage) ? 'selected' : ''; |
72 | 72 | $url = \request()->fullUrlWithQuery([$this->perPageName => $option]); |
73 | 73 |
@@ -106,7 +106,7 @@ |
||
106 | 106 | return []; |
107 | 107 | } |
108 | 108 | |
109 | - $selected = array_filter($selected, function ($value) { |
|
109 | + $selected = array_filter($selected, function($value) { |
|
110 | 110 | return !is_null($value); |
111 | 111 | }); |
112 | 112 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | * @param string $column |
58 | 58 | * @param string $label |
59 | 59 | * @param array $options |
60 | - * @param null $query |
|
60 | + * @param null|\Closure $query |
|
61 | 61 | * @param string $type |
62 | 62 | * |
63 | 63 | * @return $this |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | call_user_func($closure, $this->selector); |
28 | 28 | |
29 | - $this->header(function () { |
|
29 | + $this->header(function() { |
|
30 | 30 | return $this->renderSelector(); |
31 | 31 | }); |
32 | 32 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | $active = Selector::parseSelected(); |
48 | 48 | |
49 | - $this->selector->getSelectors()->each(function ($selector, $column) use ($active) { |
|
49 | + $this->selector->getSelectors()->each(function($selector, $column) use ($active) { |
|
50 | 50 | if (!array_key_exists($column, $active)) { |
51 | 51 | return; |
52 | 52 | } |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | return $content |
27 | 27 | ->title(trans('admin.menu')) |
28 | 28 | ->description(trans('admin.list')) |
29 | - ->row(function (Row $row) { |
|
29 | + ->row(function(Row $row) { |
|
30 | 30 | $row->column(6, $this->treeView()->render()); |
31 | 31 | |
32 | - $row->column(6, function (Column $column) { |
|
32 | + $row->column(6, function(Column $column) { |
|
33 | 33 | $form = new \Encore\Admin\Widgets\Form(); |
34 | 34 | $form->action(admin_url('auth/menu')); |
35 | 35 | |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | { |
72 | 72 | $menuModel = config('admin.database.menu_model'); |
73 | 73 | |
74 | - return $menuModel::tree(function (Tree $tree) { |
|
74 | + return $menuModel::tree(function(Tree $tree) { |
|
75 | 75 | $tree->disableCreate(); |
76 | 76 | |
77 | - $tree->branch(function ($branch) { |
|
77 | + $tree->branch(function($branch) { |
|
78 | 78 | $payload = "<i class='fa {$branch['icon']}'></i> <strong>{$branch['title']}</strong>"; |
79 | 79 | |
80 | 80 | if (!isset($branch['children'])) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->map(function ($item) use ($style) { |
|
16 | + return collect((array) $this->value)->map(function($item) use ($style) { |
|
17 | 17 | if (is_array($style)) { |
18 | 18 | if (is_string($this->getColumn()->getOriginal()) || is_int($this->getColumn()->getOriginal())) { |
19 | 19 | $style = Arr::get($style, $this->getColumn()->getOriginal(), 'success'); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | /** |
41 | 41 | * Set row model. |
42 | 42 | * |
43 | - * @param mixed $key |
|
43 | + * @param string $key |
|
44 | 44 | * |
45 | 45 | * @return \Illuminate\Database\Eloquent\Model|mixed |
46 | 46 | */ |