@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Encore\Admin\Admin; |
| 6 | 6 | use Encore\Admin\Form\Field; |
| 7 | -use Illuminate\Support\Arr; |
|
| 8 | 7 | |
| 9 | 8 | /** |
| 10 | 9 | * @mixin Field |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|string |
|
| 67 | + * @return null|string |
|
| 68 | 68 | */ |
| 69 | 69 | protected function renderFilePicker() |
| 70 | 70 | { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | protected $append; |
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | - * @param mixed $string |
|
| 18 | + * @param string $string |
|
| 19 | 19 | * |
| 20 | 20 | * @return $this |
| 21 | 21 | */ |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @param mixed $string |
|
| 32 | + * @param string $string |
|
| 33 | 33 | * @return $this |
| 34 | 34 | */ |
| 35 | 35 | public function append($string) |
@@ -59,7 +59,6 @@ |
||
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * @param string $wrap |
|
| 63 | 62 | */ |
| 64 | 63 | protected function addPickBtn($btn) |
| 65 | 64 | { |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | $this->value = json_encode($this->value, JSON_PRETTY_PRINT); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $this->mountPicker(function ($btn) { |
|
| 51 | + $this->mountPicker(function($btn) { |
|
| 52 | 52 | $this->addPickBtn($btn); |
| 53 | 53 | }); |
| 54 | 54 | |
@@ -55,7 +55,6 @@ |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * @param int $multiple |
|
| 59 | 58 | * |
| 60 | 59 | * @return string |
| 61 | 60 | */ |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | $value = explode($this->separator, $value); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - return collect(Arr::wrap($value))->map(function ($item) use ($field) { |
|
| 128 | + return collect(Arr::wrap($value))->map(function($item) use ($field) { |
|
| 129 | 129 | return [ |
| 130 | 130 | 'url' => $this->field->objectUrl($item), |
| 131 | 131 | 'value' => $item, |
@@ -55,7 +55,6 @@ |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | - * @param int $multiple |
|
| 59 | 58 | * |
| 60 | 59 | * @return string |
| 61 | 60 | */ |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | return Admin::component('admin::components.column-expand', [ |
| 28 | 28 | 'key' => $this->getKey(), |
| 29 | 29 | 'url' => $this->getLoadUrl(), |
| 30 | - 'name' => $this->column->getName() . '-' . $this->getKey(), |
|
| 30 | + 'name' => $this->column->getName().'-'.$this->getKey(), |
|
| 31 | 31 | 'html' => $html, |
| 32 | 32 | 'value' => $this->value, |
| 33 | 33 | 'async' => $async, |
@@ -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 | } |
@@ -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 null|string |
|
| 32 | 31 | */ |
| 33 | 32 | public function display($callback = null) |
| 34 | 33 | { |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -20,6 +20,4 @@ |
||
| 20 | 20 | }); |
| 21 | 21 | SCRIPT); |
| 22 | 22 | |
| 23 | - return $this; |
|
| 24 | - } |
|
| 25 | -} |
|
| 23 | + return $this |
|
| 26 | 24 | \ No newline at end of file |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | /** |
| 358 | 358 | * Get name of this column. |
| 359 | 359 | * |
| 360 | - * @return mixed |
|
| 360 | + * @return string |
|
| 361 | 361 | */ |
| 362 | 362 | public function getName() |
| 363 | 363 | { |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | /** |
| 396 | 396 | * Get label of the column. |
| 397 | 397 | * |
| 398 | - * @return mixed |
|
| 398 | + * @return string |
|
| 399 | 399 | */ |
| 400 | 400 | public function getLabel() |
| 401 | 401 | { |
@@ -900,7 +900,6 @@ discard block |
||
| 900 | 900 | /** |
| 901 | 901 | * Grid inline date picker. |
| 902 | 902 | * |
| 903 | - * @param string $format |
|
| 904 | 903 | * |
| 905 | 904 | * @return $this |
| 906 | 905 | */ |
@@ -912,7 +911,6 @@ discard block |
||
| 912 | 911 | /** |
| 913 | 912 | * Grid inline time picker. |
| 914 | 913 | * |
| 915 | - * @param string $format |
|
| 916 | 914 | * |
| 917 | 915 | * @return $this |
| 918 | 916 | */ |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | $name = $this->getName(); |
| 491 | 491 | $query = request()->query(); |
| 492 | 492 | |
| 493 | - $this->prefix(function ($_, $original) use ($name, $query) { |
|
| 493 | + $this->prefix(function($_, $original) use ($name, $query) { |
|
| 494 | 494 | Arr::set($query, $name, $original); |
| 495 | 495 | |
| 496 | 496 | $url = request()->fullUrlWithQuery($query); |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | |
| 542 | 542 | $column = $this; |
| 543 | 543 | |
| 544 | - return $this->display(function ($value) use ($grid, $column, $abstract, $arguments) { |
|
| 544 | + return $this->display(function($value) use ($grid, $column, $abstract, $arguments) { |
|
| 545 | 545 | /** @var AbstractDisplayer $displayer */ |
| 546 | 546 | $displayer = new $abstract($value, $grid, $column, $this); |
| 547 | 547 | |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | */ |
| 560 | 560 | public function using(array $values, $default = null) |
| 561 | 561 | { |
| 562 | - return $this->display(function ($value) use ($values, $default) { |
|
| 562 | + return $this->display(function($value) use ($values, $default) { |
|
| 563 | 563 | if (is_null($value)) { |
| 564 | 564 | return $default; |
| 565 | 565 | } |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | */ |
| 578 | 578 | public function replace(array $replacements) |
| 579 | 579 | { |
| 580 | - return $this->display(function ($value) use ($replacements) { |
|
| 580 | + return $this->display(function($value) use ($replacements) { |
|
| 581 | 581 | if (isset($replacements[$value])) { |
| 582 | 582 | return $replacements[$value]; |
| 583 | 583 | } |
@@ -595,13 +595,13 @@ discard block |
||
| 595 | 595 | public function repeat($input, $seperator = '') |
| 596 | 596 | { |
| 597 | 597 | if (is_string($input)) { |
| 598 | - $input = function () use ($input) { |
|
| 598 | + $input = function() use ($input) { |
|
| 599 | 599 | return $input; |
| 600 | 600 | }; |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | if ($input instanceof Closure) { |
| 604 | - return $this->display(function ($value) use ($input, $seperator) { |
|
| 604 | + return $this->display(function($value) use ($input, $seperator) { |
|
| 605 | 605 | return join($seperator, array_fill(0, (int) $value, $input->call($this, [$value]))); |
| 606 | 606 | }); |
| 607 | 607 | } |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | */ |
| 619 | 619 | public function view($view) |
| 620 | 620 | { |
| 621 | - return $this->display(function ($value) use ($view) { |
|
| 621 | + return $this->display(function($value) use ($view) { |
|
| 622 | 622 | $model = $this; |
| 623 | 623 | |
| 624 | 624 | return view($view, compact('model', 'value'))->render(); |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | */ |
| 659 | 659 | public function filesize() |
| 660 | 660 | { |
| 661 | - return $this->display(function ($value) { |
|
| 661 | + return $this->display(function($value) { |
|
| 662 | 662 | return file_size($value); |
| 663 | 663 | }); |
| 664 | 664 | } |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | */ |
| 673 | 673 | public function gravatar($size = 30) |
| 674 | 674 | { |
| 675 | - return $this->display(function ($value) use ($size) { |
|
| 675 | + return $this->display(function($value) use ($size) { |
|
| 676 | 676 | $src = sprintf( |
| 677 | 677 | 'https://www.gravatar.com/avatar/%s?s=%d', |
| 678 | 678 | md5(strtolower($value)), |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | */ |
| 694 | 694 | public function loading($values = [], $others = []) |
| 695 | 695 | { |
| 696 | - return $this->display(function ($value) use ($values, $others) { |
|
| 696 | + return $this->display(function($value) use ($values, $others) { |
|
| 697 | 697 | $values = (array) $values; |
| 698 | 698 | |
| 699 | 699 | if (in_array($value, $values)) { |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | */ |
| 715 | 715 | public function icon(array $setting, $default = '') |
| 716 | 716 | { |
| 717 | - return $this->display(function ($value) use ($setting, $default) { |
|
| 717 | + return $this->display(function($value) use ($setting, $default) { |
|
| 718 | 718 | $fa = ''; |
| 719 | 719 | |
| 720 | 720 | if (isset($setting[$value])) { |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | Carbon::setLocale($locale); |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - return $this->display(function ($value) { |
|
| 743 | + return $this->display(function($value) { |
|
| 744 | 744 | return Carbon::parse($value)->diffForHumans(); |
| 745 | 745 | }); |
| 746 | 746 | } |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | */ |
| 770 | 770 | public function bool(array $map = [], $default = false) |
| 771 | 771 | { |
| 772 | - return $this->display(function ($value) use ($map, $default) { |
|
| 772 | + return $this->display(function($value) use ($map, $default) { |
|
| 773 | 773 | $bool = empty($map) ? boolval($value) : Arr::get($map, $value, $default); |
| 774 | 774 | |
| 775 | 775 | return $bool ? '<i class="fa fa-check text-green"></i>' : '<i class="fa fa-close text-red"></i>'; |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | */ |
| 785 | 785 | public function default($default = '-') |
| 786 | 786 | { |
| 787 | - return $this->display(function ($value) use ($default) { |
|
| 787 | + return $this->display(function($value) use ($default) { |
|
| 788 | 788 | return $value ?: $default; |
| 789 | 789 | }); |
| 790 | 790 | } |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | |
| 805 | 805 | $grid = $this->grid; |
| 806 | 806 | |
| 807 | - return $this->display(function ($_, $column) use ($action, $grid) { |
|
| 807 | + return $this->display(function($_, $column) use ($action, $grid) { |
|
| 808 | 808 | /** @var RowAction $action */ |
| 809 | 809 | $action = new $action(); |
| 810 | 810 | |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | */ |
| 827 | 827 | public function dot($options = [], $default = '') |
| 828 | 828 | { |
| 829 | - return $this->prefix(function ($_, $original) use ($options, $default) { |
|
| 829 | + return $this->prefix(function($_, $original) use ($options, $default) { |
|
| 830 | 830 | if (is_null($original)) { |
| 831 | 831 | $style = $default; |
| 832 | 832 | } else { |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | $grid = $this->grid; |
| 1038 | 1038 | $column = $this; |
| 1039 | 1039 | |
| 1040 | - $this->display(function ($value) use ($grid, $column, $class) { |
|
| 1040 | + $this->display(function($value) use ($grid, $column, $class) { |
|
| 1041 | 1041 | /** @var AbstractDisplayer $definition */ |
| 1042 | 1042 | $definition = new $class($value, $grid, $column, $this); |
| 1043 | 1043 | |
@@ -1055,7 +1055,7 @@ discard block |
||
| 1055 | 1055 | protected function htmlEntityEncode($item) |
| 1056 | 1056 | { |
| 1057 | 1057 | if (is_array($item)) { |
| 1058 | - array_walk_recursive($item, function (&$value) { |
|
| 1058 | + array_walk_recursive($item, function(&$value) { |
|
| 1059 | 1059 | $value = htmlentities($value); |
| 1060 | 1060 | }); |
| 1061 | 1061 | } else { |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | */ |
| 1093 | 1093 | protected function callSupportDisplayer($abstract, $arguments) |
| 1094 | 1094 | { |
| 1095 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 1095 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 1096 | 1096 | if (is_array($value) || $value instanceof Arrayable) { |
| 1097 | 1097 | return call_user_func_array([collect($value), $abstract], $arguments); |
| 1098 | 1098 | } |
@@ -1116,7 +1116,7 @@ discard block |
||
| 1116 | 1116 | protected function callBuiltinDisplayer($abstract, $arguments) |
| 1117 | 1117 | { |
| 1118 | 1118 | if ($abstract instanceof Closure) { |
| 1119 | - return $this->display(function ($value) use ($abstract, $arguments) { |
|
| 1119 | + return $this->display(function($value) use ($abstract, $arguments) { |
|
| 1120 | 1120 | return $abstract->call($this, ...array_merge([$value], $arguments)); |
| 1121 | 1121 | }); |
| 1122 | 1122 | } |
@@ -1125,7 +1125,7 @@ discard block |
||
| 1125 | 1125 | $grid = $this->grid; |
| 1126 | 1126 | $column = $this; |
| 1127 | 1127 | |
| 1128 | - return $this->display(function ($value) use ($abstract, $grid, $column, $arguments) { |
|
| 1128 | + return $this->display(function($value) use ($abstract, $grid, $column, $arguments) { |
|
| 1129 | 1129 | /** @var AbstractDisplayer $displayer */ |
| 1130 | 1130 | $displayer = new $abstract($value, $grid, $column, $this); |
| 1131 | 1131 | |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | 'scopes' => $filter->getScopes(), |
| 23 | 23 | 'label' => $label, |
| 24 | 24 | 'cancel' => $filter->urlWithoutScopes(), |
| 25 | - 'btn_class' => uniqid() . '-filter-btn', |
|
| 25 | + 'btn_class' => uniqid().'-filter-btn', |
|
| 26 | 26 | 'expand' => $filter->expand, |
| 27 | 27 | 'filter_id' => $filter->getFilterID(), |
| 28 | 28 | ]); |