@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | /** |
360 | 360 | * Get name of this column. |
361 | 361 | * |
362 | - * @return mixed |
|
362 | + * @return string |
|
363 | 363 | */ |
364 | 364 | public function getName() |
365 | 365 | { |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | /** |
398 | 398 | * Get label of the column. |
399 | 399 | * |
400 | - * @return mixed |
|
400 | + * @return string |
|
401 | 401 | */ |
402 | 402 | public function getLabel() |
403 | 403 | { |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | * Display using display abstract. |
536 | 536 | * |
537 | 537 | * @param string $abstract |
538 | - * @param array $arguments |
|
538 | + * @param string[] $arguments |
|
539 | 539 | * |
540 | 540 | * @return $this |
541 | 541 | */ |
@@ -79,7 +79,7 @@ |
||
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | - * @param mixed $key |
|
82 | + * @param string $key |
|
83 | 83 | * @return mixed |
84 | 84 | */ |
85 | 85 | public function getAttribute($key) |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Encore\Admin\Grid\Displayers; |
4 | 4 | |
5 | 5 | use Encore\Admin\Admin; |
6 | -use Encore\Admin\Grid\Selectable; |
|
7 | 6 | use Illuminate\Database\Eloquent\Relations\BelongsToMany as Relation; |
8 | 7 | use Illuminate\Support\Arr; |
9 | 8 |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $this->disablePagination(); |
87 | 87 | } |
88 | 88 | |
89 | - $this->tools(function (Tools $tools) { |
|
89 | + $this->tools(function(Tools $tools) { |
|
90 | 90 | $tools->append(new Grid\Selectable\BrowserBtn()); |
91 | 91 | }); |
92 | 92 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $hide = $hide ? 'hide' : ''; |
99 | 99 | $key = $this->key; |
100 | 100 | |
101 | - $this->column('__remove__', ' ')->display(function () use ($hide, $key) { |
|
101 | + $this->column('__remove__', ' ')->display(function() use ($hide, $key) { |
|
102 | 102 | return <<<BTN |
103 | 103 | <a href="javascript:void(0);" class="grid-row-remove {$hide}" data-key="{$this->getAttribute($key)}"> |
104 | 104 | <i class="fa fa-trash"></i> |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | return $ret; |
242 | 242 | } |
243 | 243 | |
244 | - collect(explode(',', $id))->filter()->each(function ($id) { |
|
244 | + collect(explode(',', $id))->filter()->each(function($id) { |
|
245 | 245 | $builder = $this->model()->newQuery(); |
246 | 246 | |
247 | 247 | if ($this->isSoftDeletes) { |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | |
295 | 295 | $data = $model->toArray(); |
296 | 296 | |
297 | - $this->builder->fields()->filter(function ($field) { |
|
297 | + $this->builder->fields()->filter(function($field) { |
|
298 | 298 | return $field instanceof Field\File; |
299 | - })->each(function (Field\File $file) use ($data) { |
|
299 | + })->each(function(Field\File $file) use ($data) { |
|
300 | 300 | $file->setOriginal($data); |
301 | 301 | |
302 | 302 | $file->destroy(); |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | return $response; |
322 | 322 | } |
323 | 323 | |
324 | - DB::transaction(function () { |
|
324 | + DB::transaction(function() { |
|
325 | 325 | $inserts = $this->prepareInsert($this->updates); |
326 | 326 | |
327 | 327 | foreach ($inserts as $column => $value) { |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | /** @var Field $field */ |
396 | 396 | foreach ($this->builder()->fields() as $field) { |
397 | - if (! \request()->has($field->column())) { |
|
397 | + if (!\request()->has($field->column())) { |
|
398 | 398 | continue; |
399 | 399 | } |
400 | 400 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | return $response; |
524 | 524 | } |
525 | 525 | |
526 | - DB::transaction(function () { |
|
526 | + DB::transaction(function() { |
|
527 | 527 | $updates = $this->prepareUpdate($this->updates); |
528 | 528 | |
529 | 529 | foreach ($updates as $column => $value) { |
@@ -1003,7 +1003,7 @@ discard block |
||
1003 | 1003 | protected function getFieldByColumn($column) |
1004 | 1004 | { |
1005 | 1005 | return $this->builder->fields()->first( |
1006 | - function (Field $field) use ($column) { |
|
1006 | + function(Field $field) use ($column) { |
|
1007 | 1007 | if (is_array($field->column())) { |
1008 | 1008 | return in_array($column, $field->column()); |
1009 | 1009 | } |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | { |
1023 | 1023 | $values = $this->model->toArray(); |
1024 | 1024 | |
1025 | - $this->builder->fields()->each(function (Field $field) use ($values) { |
|
1025 | + $this->builder->fields()->each(function(Field $field) use ($values) { |
|
1026 | 1026 | $field->setOriginal($values); |
1027 | 1027 | }); |
1028 | 1028 | } |
@@ -1050,7 +1050,7 @@ discard block |
||
1050 | 1050 | |
1051 | 1051 | $data = $this->model->toArray(); |
1052 | 1052 | |
1053 | - $this->builder->fields()->each(function (Field $field) use ($data) { |
|
1053 | + $this->builder->fields()->each(function(Field $field) use ($data) { |
|
1054 | 1054 | if (!in_array($field->column(), $this->ignored, true)) { |
1055 | 1055 | $field->fill($data); |
1056 | 1056 | } |
@@ -1180,7 +1180,7 @@ discard block |
||
1180 | 1180 | */ |
1181 | 1181 | public function setWidth($fieldWidth = 8, $labelWidth = 2): self |
1182 | 1182 | { |
1183 | - $this->builder()->fields()->each(function ($field) use ($fieldWidth, $labelWidth) { |
|
1183 | + $this->builder()->fields()->each(function($field) use ($fieldWidth, $labelWidth) { |
|
1184 | 1184 | /* @var Field $field */ |
1185 | 1185 | $field->setWidth($fieldWidth, $labelWidth); |
1186 | 1186 | }); |