@@ -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 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | $tree->disableCreate(); |
| 77 | 77 | |
| 78 | - $tree->branch(function ($branch) { |
|
| 78 | + $tree->branch(function($branch) { |
|
| 79 | 79 | $payload = "<i class='fa {$branch['icon']}'></i> <strong>{$branch['title']}</strong>"; |
| 80 | 80 | |
| 81 | 81 | if (!isset($branch['children'])) { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function handle() |
| 50 | 50 | { |
| 51 | - $routes = collect($this->router->getRoutes())->filter(function (Route $route) { |
|
| 51 | + $routes = collect($this->router->getRoutes())->filter(function(Route $route) { |
|
| 52 | 52 | $uri = $route->uri(); |
| 53 | 53 | // built-in, parameterized and no-GET are ignored |
| 54 | 54 | return Str::startsWith($uri, 'admin/') |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | && !Str::contains($uri, '{') |
| 58 | 58 | && in_array('GET', $route->methods()); |
| 59 | 59 | }) |
| 60 | - ->map(function (Route $route) { |
|
| 60 | + ->map(function(Route $route) { |
|
| 61 | 61 | $uri = substr($route->uri(), strlen('admin/')); |
| 62 | 62 | |
| 63 | 63 | return [ |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | $menus = Menu::all()->pluck('title', 'uri'); |
| 73 | 73 | // exclude exist ones |
| 74 | - $news = $routes->diffKeys($menus)->map(function ($item, $key) { |
|
| 74 | + $news = $routes->diffKeys($menus)->map(function($item, $key) { |
|
| 75 | 75 | return [ |
| 76 | 76 | 'title' => $item, |
| 77 | 77 | 'uri' => $key, |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | } else { |
| 86 | 86 | if ($this->hasOption('dry-run') && $this->option('dry-run')) { |
| 87 | 87 | $this->line('<info>The following menu items will be created</info>: '); |
| 88 | - $this->table(['Title', 'Uri'], array_map(function ($item) { |
|
| 88 | + $this->table(['Title', 'Uri'], array_map(function($item) { |
|
| 89 | 89 | return [ |
| 90 | 90 | $item['title'], |
| 91 | 91 | $item['uri'], |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | // for create or update |
| 156 | 156 | if ($this->pathColumn) { |
| 157 | - $targets = array_map(function ($target) { |
|
| 157 | + $targets = array_map(function($target) { |
|
| 158 | 158 | return [$this->pathColumn => $target]; |
| 159 | 159 | }, $targets); |
| 160 | 160 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | { |
| 186 | 186 | $this->name = $this->getStoreName($file); |
| 187 | 187 | |
| 188 | - return tap($this->upload($file), function () { |
|
| 188 | + return tap($this->upload($file), function() { |
|
| 189 | 189 | $this->name = null; |
| 190 | 190 | }); |
| 191 | 191 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | 31 | try { |
| 32 | - DB::transaction(function () use ($model) { |
|
| 32 | + DB::transaction(function() use ($model) { |
|
| 33 | 33 | $model->delete(); |
| 34 | 34 | }); |
| 35 | 35 | } catch (\Exception $exception) { |
@@ -139,16 +139,16 @@ discard block |
||
| 139 | 139 | call_user_func($this->callback, $this); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $response = function () { |
|
| 142 | + $response = function() { |
|
| 143 | 143 | $handle = fopen('php://output', 'w'); |
| 144 | 144 | $titles = []; |
| 145 | 145 | |
| 146 | - $this->chunk(function ($collection) use ($handle, &$titles) { |
|
| 146 | + $this->chunk(function($collection) use ($handle, &$titles) { |
|
| 147 | 147 | Column::setOriginalGridModels($collection); |
| 148 | 148 | |
| 149 | 149 | $original = $current = $collection->toArray(); |
| 150 | 150 | |
| 151 | - $this->grid->getColumns()->map(function (Column $column) use (&$current) { |
|
| 151 | + $this->grid->getColumns()->map(function(Column $column) use (&$current) { |
|
| 152 | 152 | $current = $column->fill($current); |
| 153 | 153 | $this->grid->columnNames[] = $column->getName(); |
| 154 | 154 | }); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | protected function getVisiableTitles() |
| 178 | 178 | { |
| 179 | 179 | $titles = $this->grid->visibleColumns() |
| 180 | - ->mapWithKeys(function (Column $column) { |
|
| 180 | + ->mapWithKeys(function(Column $column) { |
|
| 181 | 181 | return [$column->getName() => $column->getLabel()]; |
| 182 | 182 | }); |
| 183 | 183 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | /** |
| 360 | 360 | * Get name of this column. |
| 361 | 361 | * |
| 362 | - * @return mixed |
|
| 362 | + * @return string |
|
| 363 | 363 | */ |
| 364 | 364 | public function getName() |
| 365 | 365 | { |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | /** |
| 398 | 398 | * Get label of the column. |
| 399 | 399 | * |
| 400 | - * @return mixed |
|
| 400 | + * @return string |
|
| 401 | 401 | */ |
| 402 | 402 | public function getLabel() |
| 403 | 403 | { |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | * Display using display abstract. |
| 536 | 536 | * |
| 537 | 537 | * @param string $abstract |
| 538 | - * @param array $arguments |
|
| 538 | + * @param string[] $arguments |
|
| 539 | 539 | * |
| 540 | 540 | * @return $this |
| 541 | 541 | */ |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | $name = $this->getName(); |
| 493 | 493 | $query = request()->query(); |
| 494 | 494 | |
| 495 | - $this->prefix(function ($_, $original) use ($name, $query) { |
|
| 495 | + $this->prefix(function($_, $original) use ($name, $query) { |
|
| 496 | 496 | Arr::set($query, $name, $original); |
| 497 | 497 | |
| 498 | 498 | $url = request()->fullUrlWithQuery($query); |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | $column = $this; |
| 545 | 545 | |
| 546 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
| 546 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
| 547 | 547 | /** @var AbstractDisplayer $displayer */ |
| 548 | 548 | $displayer = new $abstract($value, $grid, $column, $this); |
| 549 | 549 | |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | */ |
| 562 | 562 | public function using(array $values, $default = null) |
| 563 | 563 | { |
| 564 | - return $this->display(function ($value) use ($values, $default) { |
|
| 564 | + return $this->display(function($value) use ($values, $default) { |
|
| 565 | 565 | if (is_null($value)) { |
| 566 | 566 | return $default; |
| 567 | 567 | } |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | */ |
| 580 | 580 | public function replace(array $replacements) |
| 581 | 581 | { |
| 582 | - return $this->display(function ($value) use ($replacements) { |
|
| 582 | + return $this->display(function($value) use ($replacements) { |
|
| 583 | 583 | if (isset($replacements[$value])) { |
| 584 | 584 | return $replacements[$value]; |
| 585 | 585 | } |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | */ |
| 598 | 598 | public function view($view) |
| 599 | 599 | { |
| 600 | - return $this->display(function ($value) use ($view) { |
|
| 600 | + return $this->display(function($value) use ($view) { |
|
| 601 | 601 | $model = $this; |
| 602 | 602 | |
| 603 | 603 | return view($view, compact('model', 'value'))->render(); |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | */ |
| 638 | 638 | public function filesize() |
| 639 | 639 | { |
| 640 | - return $this->display(function ($value) { |
|
| 640 | + return $this->display(function($value) { |
|
| 641 | 641 | return file_size($value); |
| 642 | 642 | }); |
| 643 | 643 | } |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | */ |
| 652 | 652 | public function gravatar($size = 30) |
| 653 | 653 | { |
| 654 | - return $this->display(function ($value) use ($size) { |
|
| 654 | + return $this->display(function($value) use ($size) { |
|
| 655 | 655 | $src = sprintf( |
| 656 | 656 | 'https://www.gravatar.com/avatar/%s?s=%d', |
| 657 | 657 | md5(strtolower($value)), |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | */ |
| 673 | 673 | public function loading($values = [], $others = []) |
| 674 | 674 | { |
| 675 | - return $this->display(function ($value) use ($values, $others) { |
|
| 675 | + return $this->display(function($value) use ($values, $others) { |
|
| 676 | 676 | $values = (array) $values; |
| 677 | 677 | |
| 678 | 678 | if (in_array($value, $values)) { |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | */ |
| 694 | 694 | public function icon(array $setting, $default = '') |
| 695 | 695 | { |
| 696 | - return $this->display(function ($value) use ($setting, $default) { |
|
| 696 | + return $this->display(function($value) use ($setting, $default) { |
|
| 697 | 697 | $fa = ''; |
| 698 | 698 | |
| 699 | 699 | if (isset($setting[$value])) { |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | Carbon::setLocale($locale); |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | - return $this->display(function ($value) { |
|
| 722 | + return $this->display(function($value) { |
|
| 723 | 723 | return Carbon::parse($value)->diffForHumans(); |
| 724 | 724 | }); |
| 725 | 725 | } |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | */ |
| 734 | 734 | public function date($format) |
| 735 | 735 | { |
| 736 | - return $this->display(function ($value) use ($format) { |
|
| 736 | + return $this->display(function($value) use ($format) { |
|
| 737 | 737 | return date($format, strtotime($value)); |
| 738 | 738 | }); |
| 739 | 739 | } |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | */ |
| 749 | 749 | public function bool(array $map = [], $default = false) |
| 750 | 750 | { |
| 751 | - return $this->display(function ($value) use ($map, $default) { |
|
| 751 | + return $this->display(function($value) use ($map, $default) { |
|
| 752 | 752 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
| 753 | 753 | |
| 754 | 754 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | */ |
| 764 | 764 | public function default($default = '-') |
| 765 | 765 | { |
| 766 | - return $this->display(function ($value) use ($default) { |
|
| 766 | + return $this->display(function($value) use ($default) { |
|
| 767 | 767 | return $value ?: $default; |
| 768 | 768 | }); |
| 769 | 769 | } |
@@ -783,7 +783,7 @@ discard block |
||
| 783 | 783 | |
| 784 | 784 | $grid = $this->grid; |
| 785 | 785 | |
| 786 | - return $this->display(function ($_, $column) use ($action, $grid) { |
|
| 786 | + return $this->display(function($_, $column) use ($action, $grid) { |
|
| 787 | 787 | /** @var RowAction $action */ |
| 788 | 788 | $action = new $action(); |
| 789 | 789 | |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | */ |
| 806 | 806 | public function dot($options = [], $default = '') |
| 807 | 807 | { |
| 808 | - return $this->prefix(function ($_, $original) use ($options, $default) { |
|
| 808 | + return $this->prefix(function($_, $original) use ($options, $default) { |
|
| 809 | 809 | if (is_null($original)) { |
| 810 | 810 | $style = $default; |
| 811 | 811 | } else { |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | $grid = $this->grid; |
| 961 | 961 | $column = $this; |
| 962 | 962 | |
| 963 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
| 963 | + $this->display(function($value) use ($grid, $column, $class) { |
|
| 964 | 964 | /** @var AbstractDisplayer $definition */ |
| 965 | 965 | $definition = new $class($value, $grid, $column, $this); |
| 966 | 966 | |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | protected function htmlEntityEncode($item) |
| 979 | 979 | { |
| 980 | 980 | if (is_array($item)) { |
| 981 | - array_walk_recursive($item, function (&$value) { |
|
| 981 | + array_walk_recursive($item, function(&$value) { |
|
| 982 | 982 | $value = htmlentities($value); |
| 983 | 983 | }); |
| 984 | 984 | } else { |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | */ |
| 1016 | 1016 | protected function callSupportDisplayer($abstract, $arguments) |
| 1017 | 1017 | { |
| 1018 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 1018 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 1019 | 1019 | if (is_array($value) || $value instanceof Arrayable) { |
| 1020 | 1020 | return call_user_func_array([collect($value), $abstract], $arguments); |
| 1021 | 1021 | } |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | protected function callBuiltinDisplayer($abstract, $arguments) |
| 1040 | 1040 | { |
| 1041 | 1041 | if ($abstract instanceof Closure) { |
| 1042 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 1042 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 1043 | 1043 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
| 1044 | 1044 | }); |
| 1045 | 1045 | } |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | $grid = $this->grid; |
| 1049 | 1049 | $column = $this; |
| 1050 | 1050 | |
| 1051 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
| 1051 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
| 1052 | 1052 | /** @var AbstractDisplayer $displayer */ |
| 1053 | 1053 | $displayer = new $abstract($value, $grid, $column, $this); |
| 1054 | 1054 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->disablePagination(); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $this->tools(function (Tools $tools) { |
|
| 89 | + $this->tools(function(Tools $tools) { |
|
| 90 | 90 | $tools->append(new Grid\Selectable\BrowserBtn()); |
| 91 | 91 | }); |
| 92 | 92 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $hide = $hide ? 'hide' : ''; |
| 99 | 99 | $key = $this->key; |
| 100 | 100 | |
| 101 | - $this->column('__remove__', ' ')->display(function () use ($hide, $key) { |
|
| 101 | + $this->column('__remove__', ' ')->display(function() use ($hide, $key) { |
|
| 102 | 102 | return <<<BTN |
| 103 | 103 | <a href="javascript:void(0);" class="grid-row-remove {$hide}" data-key="{$this->getAttribute($key)}"> |
| 104 | 104 | <i class="fa fa-trash"></i> |
@@ -67,7 +67,6 @@ |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | - * @param bool $multiple |
|
| 71 | 70 | * |
| 72 | 71 | * @return string |
| 73 | 72 | */ |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | - * @param mixed $key |
|
| 82 | + * @param string $key |
|
| 83 | 83 | * |
| 84 | 84 | * @return mixed |
| 85 | 85 | */ |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | protected $renderable; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | - * @param int $multiple |
|
| 17 | 16 | * |
| 18 | 17 | * @return string |
| 19 | 18 | */ |