@@ -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 |
@@ -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}\""; |
@@ -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 ''; |