@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | * |
282 | 282 | * @param string $column |
283 | 283 | * |
284 | - * @return mixed|string |
|
284 | + * @return string |
|
285 | 285 | */ |
286 | 286 | protected function formatColumn($column = '') |
287 | 287 | { |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | /** |
577 | - * @param string|array|Closure $input |
|
577 | + * @param callable|null $input |
|
578 | 578 | * @param string|array $original |
579 | 579 | * |
580 | 580 | * @return array|Closure |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | /** |
786 | 786 | * Set or get value of the field. |
787 | 787 | * |
788 | - * @param null $value |
|
788 | + * @param string $value |
|
789 | 789 | * |
790 | 790 | * @return mixed |
791 | 791 | */ |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | /** |
957 | 957 | * Add html attributes to elements. |
958 | 958 | * |
959 | - * @param array|string $attribute |
|
959 | + * @param string $attribute |
|
960 | 960 | * @param mixed $value |
961 | 961 | * |
962 | 962 | * @return $this |
@@ -1334,7 +1334,7 @@ discard block |
||
1334 | 1334 | } |
1335 | 1335 | |
1336 | 1336 | /** |
1337 | - * @param array $labelClass |
|
1337 | + * @param string[] $labelClass |
|
1338 | 1338 | * |
1339 | 1339 | * @return self |
1340 | 1340 | */ |
@@ -1389,7 +1389,7 @@ discard block |
||
1389 | 1389 | * |
1390 | 1390 | * @param string $view |
1391 | 1391 | * |
1392 | - * @return string |
|
1392 | + * @return Field |
|
1393 | 1393 | */ |
1394 | 1394 | public function setView($view): self |
1395 | 1395 | { |
@@ -112,7 +112,7 @@ |
||
112 | 112 | */ |
113 | 113 | protected static function bootHasPermissions() |
114 | 114 | { |
115 | - static::deleting(function ($model) { |
|
115 | + static::deleting(function($model) { |
|
116 | 116 | $model->roles()->detach(); |
117 | 117 | |
118 | 118 | $model->permissions()->detach(); |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | /** |
10 | 10 | * Get all permissions of user. |
11 | 11 | * |
12 | - * @return mixed |
|
12 | + * @return Collection |
|
13 | 13 | */ |
14 | 14 | public function allPermissions(): Collection |
15 | 15 | { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | /** |
20 | 20 | * Check if user has permission. |
21 | 21 | * |
22 | - * @param $ability |
|
22 | + * @param string $ability |
|
23 | 23 | * @param array $arguments |
24 | 24 | * |
25 | 25 | * @return bool |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | /** |
57 | 57 | * Check if user is administrator. |
58 | 58 | * |
59 | - * @return mixed |
|
59 | + * @return boolean |
|
60 | 60 | */ |
61 | 61 | public function isAdministrator(): bool |
62 | 62 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @param string $role |
70 | 70 | * |
71 | - * @return mixed |
|
71 | + * @return boolean |
|
72 | 72 | */ |
73 | 73 | public function isRole(string $role): bool |
74 | 74 | { |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param array $roles |
82 | 82 | * |
83 | - * @return mixed |
|
83 | + * @return boolean |
|
84 | 84 | */ |
85 | 85 | public function inRoles(array $roles = []): bool |
86 | 86 | { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @param array $forms |
14 | 14 | * @param null $active |
15 | 15 | * |
16 | - * @return mixed |
|
16 | + * @return ContainsForms |
|
17 | 17 | */ |
18 | 18 | public static function forms($forms, $active = null) |
19 | 19 | { |
@@ -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 | } |
@@ -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 |