@@ -14,7 +14,6 @@ discard block |
||
| 14 | 14 | protected $renderable; |
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | - * @param int $multiple |
|
| 18 | 17 | * |
| 19 | 18 | * @return string |
| 20 | 19 | */ |
@@ -28,7 +27,7 @@ discard block |
||
| 28 | 27 | /** |
| 29 | 28 | * @param \Closure|string $callback |
| 30 | 29 | * |
| 31 | - * @return mixed|string |
|
| 30 | + * @return string|null |
|
| 32 | 31 | */ |
| 33 | 32 | public function display($callback = null) |
| 34 | 33 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $title = $this->trans('title'); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $html = ''; |
|
| 41 | + $html = ''; |
|
| 42 | 42 | |
| 43 | 43 | if ($async = is_subclass_of($callback, Renderable::class)) { |
| 44 | 44 | $this->renderable = $callback; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | 'html' => $html, |
| 55 | 55 | 'key' => $this->getKey(), |
| 56 | 56 | 'value' => $this->value, |
| 57 | - 'name' => $this->getKey() . '-' . str_replace('.', '_', $this->getColumn()->getName()), |
|
| 57 | + 'name' => $this->getKey().'-'.str_replace('.', '_', $this->getColumn()->getName()), |
|
| 58 | 58 | ]); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -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,13 +597,13 @@ discard block |
||
| 597 | 597 | public function repeat($input, $seperator = '') |
| 598 | 598 | { |
| 599 | 599 | if (is_string($input)) { |
| 600 | - $input = function () use ($input) { |
|
| 600 | + $input = function() use ($input) { |
|
| 601 | 601 | return $input; |
| 602 | 602 | }; |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | if ($input instanceof Closure) { |
| 606 | - return $this->display(function ($value) use ($input, $seperator) { |
|
| 606 | + return $this->display(function($value) use ($input, $seperator) { |
|
| 607 | 607 | $callable = $input->bindTo($this); |
| 608 | 608 | return join($seperator, array_fill(0, (int) $value, $callable($value))); |
| 609 | 609 | }); |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | */ |
| 622 | 622 | public function view($view) |
| 623 | 623 | { |
| 624 | - return $this->display(function ($value) use ($view) { |
|
| 624 | + return $this->display(function($value) use ($view) { |
|
| 625 | 625 | $model = $this; |
| 626 | 626 | |
| 627 | 627 | return view($view, compact('model', 'value'))->render(); |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | */ |
| 662 | 662 | public function filesize() |
| 663 | 663 | { |
| 664 | - return $this->display(function ($value) { |
|
| 664 | + return $this->display(function($value) { |
|
| 665 | 665 | return file_size($value); |
| 666 | 666 | }); |
| 667 | 667 | } |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | */ |
| 676 | 676 | public function gravatar($size = 30) |
| 677 | 677 | { |
| 678 | - return $this->display(function ($value) use ($size) { |
|
| 678 | + return $this->display(function($value) use ($size) { |
|
| 679 | 679 | $src = sprintf( |
| 680 | 680 | 'https://www.gravatar.com/avatar/%s?s=%d', |
| 681 | 681 | md5(strtolower($value)), |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | */ |
| 697 | 697 | public function loading($values = [], $others = []) |
| 698 | 698 | { |
| 699 | - return $this->display(function ($value) use ($values, $others) { |
|
| 699 | + return $this->display(function($value) use ($values, $others) { |
|
| 700 | 700 | $values = (array) $values; |
| 701 | 701 | |
| 702 | 702 | if (in_array($value, $values)) { |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | */ |
| 718 | 718 | public function icon(array $setting, $default = '') |
| 719 | 719 | { |
| 720 | - return $this->display(function ($value) use ($setting, $default) { |
|
| 720 | + return $this->display(function($value) use ($setting, $default) { |
|
| 721 | 721 | $fa = ''; |
| 722 | 722 | |
| 723 | 723 | if (isset($setting[$value])) { |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | Carbon::setLocale($locale); |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - return $this->display(function ($value) { |
|
| 746 | + return $this->display(function($value) { |
|
| 747 | 747 | return Carbon::parse($value)->diffForHumans(); |
| 748 | 748 | }); |
| 749 | 749 | } |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | */ |
| 758 | 758 | public function date($format) |
| 759 | 759 | { |
| 760 | - return $this->display(function ($value) use ($format) { |
|
| 760 | + return $this->display(function($value) use ($format) { |
|
| 761 | 761 | return date($format, strtotime($value)); |
| 762 | 762 | }); |
| 763 | 763 | } |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | */ |
| 773 | 773 | public function bool(array $map = [], $default = false) |
| 774 | 774 | { |
| 775 | - return $this->display(function ($value) use ($map, $default) { |
|
| 775 | + return $this->display(function($value) use ($map, $default) { |
|
| 776 | 776 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
| 777 | 777 | |
| 778 | 778 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | */ |
| 788 | 788 | public function default($default = '-') |
| 789 | 789 | { |
| 790 | - return $this->display(function ($value) use ($default) { |
|
| 790 | + return $this->display(function($value) use ($default) { |
|
| 791 | 791 | return $value ?: $default; |
| 792 | 792 | }); |
| 793 | 793 | } |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | |
| 808 | 808 | $grid = $this->grid; |
| 809 | 809 | |
| 810 | - return $this->display(function ($_, $column) use ($action, $grid) { |
|
| 810 | + return $this->display(function($_, $column) use ($action, $grid) { |
|
| 811 | 811 | /** @var RowAction $action */ |
| 812 | 812 | $action = new $action(); |
| 813 | 813 | |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | */ |
| 830 | 830 | public function dot($options = [], $default = '') |
| 831 | 831 | { |
| 832 | - return $this->prefix(function ($_, $original) use ($options, $default) { |
|
| 832 | + return $this->prefix(function($_, $original) use ($options, $default) { |
|
| 833 | 833 | if (is_null($original)) { |
| 834 | 834 | $style = $default; |
| 835 | 835 | } else { |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | $grid = $this->grid; |
| 985 | 985 | $column = $this; |
| 986 | 986 | |
| 987 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
| 987 | + $this->display(function($value) use ($grid, $column, $class) { |
|
| 988 | 988 | /** @var AbstractDisplayer $definition */ |
| 989 | 989 | $definition = new $class($value, $grid, $column, $this); |
| 990 | 990 | |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | protected function htmlEntityEncode($item) |
| 1003 | 1003 | { |
| 1004 | 1004 | if (is_array($item)) { |
| 1005 | - array_walk_recursive($item, function (&$value) { |
|
| 1005 | + array_walk_recursive($item, function(&$value) { |
|
| 1006 | 1006 | $value = htmlentities($value); |
| 1007 | 1007 | }); |
| 1008 | 1008 | } else { |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | */ |
| 1040 | 1040 | protected function callSupportDisplayer($abstract, $arguments) |
| 1041 | 1041 | { |
| 1042 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 1042 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 1043 | 1043 | if (is_array($value) || $value instanceof Arrayable) { |
| 1044 | 1044 | return call_user_func_array([collect($value), $abstract], $arguments); |
| 1045 | 1045 | } |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | protected function callBuiltinDisplayer($abstract, $arguments) |
| 1064 | 1064 | { |
| 1065 | 1065 | if ($abstract instanceof Closure) { |
| 1066 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 1066 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 1067 | 1067 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
| 1068 | 1068 | }); |
| 1069 | 1069 | } |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | $grid = $this->grid; |
| 1073 | 1073 | $column = $this; |
| 1074 | 1074 | |
| 1075 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
| 1075 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
| 1076 | 1076 | /** @var AbstractDisplayer $displayer */ |
| 1077 | 1077 | $displayer = new $abstract($value, $grid, $column, $this); |
| 1078 | 1078 | |