@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function disableFilterButton(bool $disable = true) |
86 | 86 | { |
87 | - $this->tools = $this->tools->map(function ($tool) use ($disable) { |
|
87 | + $this->tools = $this->tools->map(function($tool) use ($disable) { |
|
88 | 88 | if ($tool instanceof FilterButton) { |
89 | 89 | return $tool->disable($disable); |
90 | 90 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function disableBatchActions(bool $disable = true) |
114 | 114 | { |
115 | - $this->tools = $this->tools->map(function ($tool) use ($disable) { |
|
115 | + $this->tools = $this->tools->map(function($tool) use ($disable) { |
|
116 | 116 | if ($tool instanceof BatchActions) { |
117 | 117 | return $tool->disable($disable); |
118 | 118 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function batch(\Closure $closure) |
128 | 128 | { |
129 | - call_user_func($closure, $this->tools->first(function ($tool) { |
|
129 | + call_user_func($closure, $this->tools->first(function($tool) { |
|
130 | 130 | return $tool instanceof BatchActions; |
131 | 131 | })); |
132 | 132 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function render() |
140 | 140 | { |
141 | - return $this->tools->map(function ($tool) { |
|
141 | + return $this->tools->map(function($tool) { |
|
142 | 142 | if ($tool instanceof AbstractTool) { |
143 | 143 | if (!$tool->allowed()) { |
144 | 144 | return ''; |
@@ -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 | { |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | /** |
507 | 507 | * Set grid action callback. |
508 | 508 | * |
509 | - * @param Closure|string $actions |
|
509 | + * @param Closure $actions |
|
510 | 510 | * |
511 | 511 | * @return $this |
512 | 512 | */ |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | /** |
839 | 839 | * Dynamically add columns to the grid view. |
840 | 840 | * |
841 | - * @param $method |
|
841 | + * @param string $method |
|
842 | 842 | * @param $arguments |
843 | 843 | * |
844 | 844 | * @return Column |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | $column = new Column($column, $label); |
359 | 359 | $column->setGrid($this); |
360 | 360 | |
361 | - return tap($column, function ($value) { |
|
361 | + return tap($column, function($value) { |
|
362 | 362 | $this->columns->push($value); |
363 | 363 | }); |
364 | 364 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $column = new Column($column, $label); |
423 | 423 | $column->setGrid($this); |
424 | 424 | |
425 | - return tap($column, function ($value) { |
|
425 | + return tap($column, function($value) { |
|
426 | 426 | $this->columns->prepend($value); |
427 | 427 | }); |
428 | 428 | } |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | |
588 | 588 | $data = $collection->toArray(); |
589 | 589 | |
590 | - $this->columns->map(function (Column $column) use (&$data) { |
|
590 | + $this->columns->map(function(Column $column) use (&$data) { |
|
591 | 591 | $data = $column->fill($data); |
592 | 592 | |
593 | 593 | $this->columnNames[] = $column->getName(); |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | */ |
608 | 608 | protected function buildRows(array $data) |
609 | 609 | { |
610 | - $this->rows = collect($data)->map(function ($model, $number) { |
|
610 | + $this->rows = collect($data)->map(function($model, $number) { |
|
611 | 611 | return new Row($number, $model); |
612 | 612 | }); |
613 | 613 |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * @param array $replace |
162 | 162 | * @param string $locale |
163 | 163 | * |
164 | - * @return \Illuminate\Contracts\Translation\Translator|string|array|null |
|
164 | + * @return string|null |
|
165 | 165 | */ |
166 | 166 | function admin_trans($key = null, $replace = [], $locale = null) |
167 | 167 | { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * Delete from array by value. |
182 | 182 | * |
183 | 183 | * @param array $array |
184 | - * @param mixed $value |
|
184 | + * @param string $value |
|
185 | 185 | */ |
186 | 186 | function array_delete(&$array, $value) |
187 | 187 | { |
@@ -289,7 +289,7 @@ |
||
289 | 289 | $value = $subArray['options']; |
290 | 290 | $original = array_merge($original, $subArray['original']); |
291 | 291 | $toReplace = array_merge($toReplace, $subArray['toReplace']); |
292 | - } elseif(strpos($value, 'function(') === 0){ |
|
292 | + } elseif (strpos($value, 'function(') === 0) { |
|
293 | 293 | $original[] = $value; |
294 | 294 | $value = "%{$key}%"; |
295 | 295 | $toReplace[] = "\"{$value}\""; |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * Generate thumbnail URL. |
32 | 32 | * |
33 | 33 | * @param $image |
34 | - * @param $type |
|
34 | + * @param string $type |
|
35 | 35 | * |
36 | 36 | * @return string |
37 | 37 | */ |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * |
55 | 55 | * @param bool $toArray |
56 | 56 | * |
57 | - * @return array|Collection|mixed |
|
57 | + * @return Collection |
|
58 | 58 | */ |
59 | 59 | public function applyFilter($toArray = true) |
60 | 60 | { |
@@ -125,14 +125,14 @@ |
||
125 | 125 | */ |
126 | 126 | protected function parseQueryBindings(array $queries) |
127 | 127 | { |
128 | - $columnMap = $this->columns->mapWithKeys(function (Column $column) { |
|
128 | + $columnMap = $this->columns->mapWithKeys(function(Column $column) { |
|
129 | 129 | $label = $column->getLabel(); |
130 | 130 | $name = $column->getName(); |
131 | 131 | |
132 | 132 | return [$label => $name, $name => $name]; |
133 | 133 | }); |
134 | 134 | |
135 | - return collect($queries)->map(function ($query) use ($columnMap) { |
|
135 | + return collect($queries)->map(function($query) use ($columnMap) { |
|
136 | 136 | $segments = explode(':', $query, 2); |
137 | 137 | |
138 | 138 | if (count($segments) != 2) { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | /** |
167 | 167 | * Extend column displayer. |
168 | 168 | * |
169 | - * @param $name |
|
169 | + * @param string $name |
|
170 | 170 | * @param $displayer |
171 | 171 | */ |
172 | 172 | public static function extend($name, $displayer) |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | /** |
201 | 201 | * Set model for column. |
202 | 202 | * |
203 | - * @param $model |
|
203 | + * @param Model $model |
|
204 | 204 | */ |
205 | 205 | public function setModel($model) |
206 | 206 | { |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | /** |
285 | 285 | * Get name of this column. |
286 | 286 | * |
287 | - * @return mixed |
|
287 | + * @return string |
|
288 | 288 | */ |
289 | 289 | public function getName() |
290 | 290 | { |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | /** |
313 | 313 | * Get label of the column. |
314 | 314 | * |
315 | - * @return mixed |
|
315 | + * @return string |
|
316 | 316 | */ |
317 | 317 | public function getLabel() |
318 | 318 | { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | * Display using display abstract. |
400 | 400 | * |
401 | 401 | * @param string $abstract |
402 | - * @param array $arguments |
|
402 | + * @param Closure[] $arguments |
|
403 | 403 | * |
404 | 404 | * @return $this |
405 | 405 | */ |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | |
410 | 410 | $column = $this; |
411 | 411 | |
412 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
412 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
413 | 413 | /** @var AbstractDisplayer $displayer */ |
414 | 414 | $displayer = new $abstract($value, $grid, $column, $this); |
415 | 415 | |
@@ -427,7 +427,7 @@ discard block |
||
427 | 427 | */ |
428 | 428 | public function using(array $values, $default = null) |
429 | 429 | { |
430 | - return $this->display(function ($value) use ($values, $default) { |
|
430 | + return $this->display(function($value) use ($values, $default) { |
|
431 | 431 | if (is_null($value)) { |
432 | 432 | return $default; |
433 | 433 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function view($view) |
447 | 447 | { |
448 | - return $this->display(function ($value) use ($view) { |
|
448 | + return $this->display(function($value) use ($view) { |
|
449 | 449 | $model = $this; |
450 | 450 | |
451 | 451 | return view($view, compact('model', 'value'))->render(); |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | */ |
486 | 486 | public function filesize() |
487 | 487 | { |
488 | - return $this->display(function ($value) { |
|
488 | + return $this->display(function($value) { |
|
489 | 489 | return file_size($value); |
490 | 490 | }); |
491 | 491 | } |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | */ |
500 | 500 | public function gravatar($size = 30) |
501 | 501 | { |
502 | - return $this->display(function ($value) use ($size) { |
|
502 | + return $this->display(function($value) use ($size) { |
|
503 | 503 | $src = sprintf( |
504 | 504 | 'https://www.gravatar.com/avatar/%s?s=%d', |
505 | 505 | md5(strtolower($value)), |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | */ |
521 | 521 | public function loading($values = [], $others = []) |
522 | 522 | { |
523 | - return $this->display(function ($value) use ($values, $others) { |
|
523 | + return $this->display(function($value) use ($values, $others) { |
|
524 | 524 | |
525 | 525 | $values = (array) $values; |
526 | 526 | |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | */ |
543 | 543 | public function icon(array $setting, $default = '') |
544 | 544 | { |
545 | - return $this->display(function ($value) use ($setting, $default) { |
|
545 | + return $this->display(function($value) use ($setting, $default) { |
|
546 | 546 | |
547 | 547 | $fa = ''; |
548 | 548 | |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | Carbon::setLocale($locale); |
570 | 570 | } |
571 | 571 | |
572 | - return $this->display(function ($value) { |
|
572 | + return $this->display(function($value) { |
|
573 | 573 | return Carbon::parse($value)->diffForHumans(); |
574 | 574 | }); |
575 | 575 | } |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | $grid = $this->grid; |
691 | 691 | $column = $this; |
692 | 692 | |
693 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
693 | + $this->display(function($value) use ($grid, $column, $class) { |
|
694 | 694 | /** @var AbstractDisplayer $definition */ |
695 | 695 | $definition = new $class($value, $grid, $column, $this); |
696 | 696 | |
@@ -708,7 +708,7 @@ discard block |
||
708 | 708 | protected function htmlEntityEncode($item) |
709 | 709 | { |
710 | 710 | if (is_array($item)) { |
711 | - array_walk_recursive($item, function (&$value) { |
|
711 | + array_walk_recursive($item, function(&$value) { |
|
712 | 712 | $value = htmlentities($value); |
713 | 713 | }); |
714 | 714 | } else { |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | 'content' => $this->help, |
797 | 797 | ]; |
798 | 798 | |
799 | - $data = collect($data)->map(function ($val, $key) { |
|
799 | + $data = collect($data)->map(function($val, $key) { |
|
800 | 800 | return "data-{$key}=\"{$val}\""; |
801 | 801 | })->implode(' '); |
802 | 802 | |
@@ -834,7 +834,7 @@ discard block |
||
834 | 834 | */ |
835 | 835 | protected function callSupportDisplayer($abstract, $arguments) |
836 | 836 | { |
837 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
837 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
838 | 838 | if (is_array($value) || $value instanceof Arrayable) { |
839 | 839 | return call_user_func_array([collect($value), $abstract], $arguments); |
840 | 840 | } |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | protected function callBuiltinDisplayer($abstract, $arguments) |
859 | 859 | { |
860 | 860 | if ($abstract instanceof Closure) { |
861 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
861 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
862 | 862 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
863 | 863 | }); |
864 | 864 | } |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | $grid = $this->grid; |
868 | 868 | $column = $this; |
869 | 869 | |
870 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
870 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
871 | 871 | /** @var AbstractDisplayer $displayer */ |
872 | 872 | $displayer = new $abstract($value, $grid, $column, $this); |
873 | 873 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $this->value = $this->value->toArray(); |
14 | 14 | } |
15 | 15 | |
16 | - return collect((array) $this->value)->filter()->map(function ($value) use ($server) { |
|
16 | + return collect((array) $this->value)->filter()->map(function($value) use ($server) { |
|
17 | 17 | |
18 | 18 | if (empty($value)) { |
19 | 19 | return ''; |