Completed
Pull Request — master (#5303)
by
unknown
03:28
created
src/Form/Field.php 1 patch
Doc Comments   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      *
283 283
      * @param string $column
284 284
      *
285
-     * @return mixed|string
285
+     * @return string
286 286
      */
287 287
     protected function formatColumn($column = '')
288 288
     {
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
     }
592 592
 
593 593
     /**
594
-     * @param string|array|Closure $input
594
+     * @param callable|null $input
595 595
      * @param string|array         $original
596 596
      *
597 597
      * @return array|Closure
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
     /**
803 803
      * Set or get value of the field.
804 804
      *
805
-     * @param null $value
805
+     * @param string $value
806 806
      *
807 807
      * @return mixed
808 808
      */
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
     /**
974 974
      * Add html attributes to elements.
975 975
      *
976
-     * @param array|string $attribute
976
+     * @param string $attribute
977 977
      * @param mixed        $value
978 978
      *
979 979
      * @return $this
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
     /**
1104 1104
      * Get placeholder.
1105 1105
      *
1106
-     * @return mixed
1106
+     * @return string
1107 1107
      */
1108 1108
     public function getPlaceholder()
1109 1109
     {
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
     }
1361 1361
 
1362 1362
     /**
1363
-     * @param array $labelClass
1363
+     * @param string[] $labelClass
1364 1364
      * @param bool  $replace
1365 1365
      *
1366 1366
      * @return self
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
      *
1416 1416
      * @param string $view
1417 1417
      *
1418
-     * @return string
1418
+     * @return Field
1419 1419
      */
1420 1420
     public function setView($view): self
1421 1421
     {
Please login to merge, or discard this patch.
src/Form/Field/PlainInput.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
29 29
     }
30 30
 
31 31
     /**
32
-     * @param mixed $string
32
+     * @param string $string
33 33
      *
34 34
      * @return $this
35 35
      */
Please login to merge, or discard this patch.
src/Grid/Tools/ColumnSelector.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,9 +33,9 @@
 block discarded – undo
33 33
      */
34 34
     protected function getGridColumns()
35 35
     {
36
-        return $this->grid->columns()->reject(function ($column) {
36
+        return $this->grid->columns()->reject(function($column) {
37 37
             return in_array($column->getName(), static::$ignored);
38
-        })->map(function ($column) {
38
+        })->map(function($column) {
39 39
             return [$column->getName() => $column->getLabel()];
40 40
         })->collapse();
41 41
     }
Please login to merge, or discard this patch.
src/Grid/Displayers/AbstractDisplayer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
     {
124 124
         $keys = collect(explode('.', $name ?: $this->getName()));
125 125
 
126
-        return $keys->shift().$keys->reduce(function ($carry, $val) {
126
+        return $keys->shift().$keys->reduce(function($carry, $val) {
127 127
             return $carry."[$val]";
128 128
         });
129 129
     }
Please login to merge, or discard this patch.
src/Grid/Displayers/SwitchGroup.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
         $this->overrideStates($states);
13 13
 
14 14
         if (!Arr::isAssoc($columns)) {
15
-            $columns = collect($columns)->map(function ($column) {
15
+            $columns = collect($columns)->map(function($column) {
16 16
                 return [$column => ucfirst($column)];
17 17
             })->collapse();
18 18
         }
Please login to merge, or discard this patch.
src/Form/Field/CanCascadeFields.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     {
105 105
         if ($this->form) {
106 106
             $this->form->fields()
107
-                ->filter(function (Form\Field $field) {
107
+                ->filter(function(Form\Field $field) {
108 108
                     return $field instanceof CascadeGroup
109 109
                         && $field->dependsOn($this)
110 110
                         && $this->hitsCondition($field);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             return;
167 167
         }
168 168
 
169
-        $cascadeGroups = collect($this->conditions)->map(function ($condition) {
169
+        $cascadeGroups = collect($this->conditions)->map(function($condition) {
170 170
             return [
171 171
                 'class'    => $this->getCascadeClass($condition['value']),
172 172
                 'operator' => $condition['operator'],
Please login to merge, or discard this patch.
src/Form/Field/Embeds.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -249,7 +249,7 @@
 block discarded – undo
249 249
     /**
250 250
      * Determine the column name to use with the embedded form.
251 251
      *
252
-     * @return array|string
252
+     * @return string
253 253
      */
254 254
     protected function getEmbeddedColumnName()
255 255
     {
Please login to merge, or discard this patch.
src/Controllers/UserController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
         $grid->column('created_at', trans('admin.created_at'));
36 36
         $grid->column('updated_at', trans('admin.updated_at'));
37 37
 
38
-        $grid->actions(function (Grid\Displayers\Actions $actions) {
38
+        $grid->actions(function(Grid\Displayers\Actions $actions) {
39 39
             if ($actions->getKey() == 1) {
40 40
                 $actions->disableDelete();
41 41
             }
42 42
         });
43 43
 
44
-        $grid->tools(function (Grid\Tools $tools) {
45
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
44
+        $grid->tools(function(Grid\Tools $tools) {
45
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
46 46
                 $actions->disableDelete();
47 47
             });
48 48
         });
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         $show->field('id', 'ID');
67 67
         $show->field('username', trans('admin.username'));
68 68
         $show->field('name', trans('admin.name'));
69
-        $show->field('roles', trans('admin.roles'))->as(function ($roles) {
69
+        $show->field('roles', trans('admin.roles'))->as(function($roles) {
70 70
             return $roles->pluck('name');
71 71
         })->label();
72
-        $show->field('permissions', trans('admin.permissions'))->as(function ($permission) {
72
+        $show->field('permissions', trans('admin.permissions'))->as(function($permission) {
73 73
             return $permission->pluck('name');
74 74
         })->label();
75 75
         $show->field('created_at', trans('admin.created_at'));
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $form->image('avatar', trans('admin.avatar'));
104 104
         $form->password('password', trans('admin.password'))->rules('required|confirmed');
105 105
         $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')
106
-            ->default(function ($form) {
106
+            ->default(function($form) {
107 107
                 return $form->model()->password;
108 108
             });
109 109
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $form->display('created_at', trans('admin.created_at'));
116 116
         $form->display('updated_at', trans('admin.updated_at'));
117 117
 
118
-        $form->saving(function (Form $form) {
118
+        $form->saving(function(Form $form) {
119 119
             if ($form->password && $form->model()->password != $form->password) {
120 120
                 $form->password = Hash::make($form->password);
121 121
             }
Please login to merge, or discard this patch.
src/Grid/Model.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
 
338 338
     /**
339
-     * @param     $callback
339
+     * @param     callable $callback
340 340
      * @param int $count
341 341
      *
342 342
      * @return LengthAwarePaginator|Collection
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
     /**
492 492
      * Resolve perPage for pagination.
493 493
      *
494
-     * @param array|null $paginate
494
+     * @param Model $paginate
495 495
      *
496 496
      * @return array
497 497
      */
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
     /**
522 522
      * Find query by method name.
523 523
      *
524
-     * @param $method
524
+     * @param string $method
525 525
      *
526 526
      * @return static
527 527
      */
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
 
676 676
     /**
677 677
      * @param string $method
678
-     * @param array  $arguments
678
+     * @param integer[]  $arguments
679 679
      *
680 680
      * @return $this
681 681
      */
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -325,9 +325,9 @@  discard block
 block discarded – undo
325 325
 
326 326
         $this->setSort();
327 327
 
328
-        $this->queries->reject(function ($query) {
328
+        $this->queries->reject(function($query) {
329 329
             return $query['method'] == 'paginate';
330
-        })->each(function ($query) {
330
+        })->each(function($query) {
331 331
             $this->model = $this->model->{$query['method']}(...$query['arguments']);
332 332
         });
333 333
 
@@ -349,9 +349,9 @@  discard block
 block discarded – undo
349 349
 
350 350
         $this->setSort();
351 351
 
352
-        $this->queries->reject(function ($query) {
352
+        $this->queries->reject(function($query) {
353 353
             return $query['method'] == 'paginate';
354
-        })->each(function ($query) {
354
+        })->each(function($query) {
355 355
             $this->model = $this->model->{$query['method']}(...$query['arguments']);
356 356
         });
357 357
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         $this->setSort();
404 404
         $this->setPaginate();
405 405
 
406
-        $this->queries->unique()->each(function ($query) {
406
+        $this->queries->unique()->each(function($query) {
407 407
             $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']);
408 408
         });
409 409
 
@@ -433,9 +433,9 @@  discard block
 block discarded – undo
433 433
 
434 434
         $queryBuilder = $this->originalModel;
435 435
 
436
-        $this->queries->reject(function ($query) {
436
+        $this->queries->reject(function($query) {
437 437
             return in_array($query['method'], ['get', 'paginate']);
438
-        })->each(function ($query) use (&$queryBuilder) {
438
+        })->each(function($query) use (&$queryBuilder) {
439 439
             $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']);
440 440
         });
441 441
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
     {
470 470
         $paginate = $this->findQueryByMethod('paginate');
471 471
 
472
-        $this->queries = $this->queries->reject(function ($query) {
472
+        $this->queries = $this->queries->reject(function($query) {
473 473
             return $query['method'] == 'paginate';
474 474
         });
475 475
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
      */
528 528
     protected function findQueryByMethod($method)
529 529
     {
530
-        return $this->queries->first(function ($query) use ($method) {
530
+        return $this->queries->first(function($query) use ($method) {
531 531
             return $query['method'] == $method;
532 532
         });
533 533
     }
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
         }
551 551
 
552 552
         $columnNameContainsDots = Str::contains($columnName, '.');
553
-        $isRelation = $this->queries->contains(function ($query) use ($columnName) {
553
+        $isRelation = $this->queries->contains(function($query) use ($columnName) {
554 554
             return $query['method'] === 'with' && in_array($columnName, $query['arguments'], true);
555 555
         });
556 556
         if ($columnNameContainsDots === true && $isRelation) {
@@ -594,9 +594,9 @@  discard block
 block discarded – undo
594 594
      */
595 595
     protected function setRelationSort($column)
596 596
     {
597
-        [ $relationName, $relationColumn ] = explode('.', $column);
597
+        [$relationName, $relationColumn] = explode('.', $column);
598 598
 
599
-        if ($this->queries->contains(function ($query) use ($relationName) {
599
+        if ($this->queries->contains(function($query) use ($relationName) {
600 600
             return $query['method'] == 'with' && in_array($relationName, $query['arguments']);
601 601
         })) {
602 602
             $relation = $this->model->$relationName();
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
      */
631 631
     public function resetOrderBy()
632 632
     {
633
-        $this->queries = $this->queries->reject(function ($query) {
633
+        $this->queries = $this->queries->reject(function($query) {
634 634
             return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc';
635 635
         });
636 636
     }
Please login to merge, or discard this patch.