Completed
Pull Request — master (#4709)
by
unknown
02:27
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
      *
1365 1365
      * @return self
1366 1366
      */
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
      *
1415 1415
      * @param string $view
1416 1416
      *
1417
-     * @return string
1417
+     * @return Field
1418 1418
      */
1419 1419
     public function setView($view): self
1420 1420
     {
Please login to merge, or discard this patch.
src/Form/Field/HasValuePicker.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
     }
65 65
 
66 66
     /**
67
-     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|string
67
+     * @return string|null
68 68
      */
69 69
     protected function renderFilePicker()
70 70
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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
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
      * @return $this
34 34
      */
35 35
     public function append($string)
Please login to merge, or discard this patch.
src/Form/Field/Textarea.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,6 @@
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @param string $wrap
63 62
      */
64 63
     protected function addPickBtn($btn)
65 64
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Form/Field/ValuePicker.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,6 @@
 block discarded – undo
55 55
     }
56 56
 
57 57
     /**
58
-     * @param int $multiple
59 58
      *
60 59
      * @return string
61 60
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/Grid/Displayers/Expand.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,6 @@
 block discarded – undo
55 55
     }
56 56
 
57 57
     /**
58
-     * @param int $multiple
59 58
      *
60 59
      * @return string
61 60
      */
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
src/Grid/Displayers/Modal.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Grid/Concerns/CanDoubleClick.php 7 patches
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
Please login to merge, or discard this patch.
Switch Indentation   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,6 +20,4 @@
 block discarded – undo
20 20
 });
21 21
 SCRIPT);
22 22
 
23
-        return $this;
24
-    }
25
-}
23
+        return $this
26 24
\ No newline at end of file
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
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
     /**
467 467
      * Resolve perPage for pagination.
468 468
      *
469
-     * @param array|null $paginate
469
+     * @param Model $paginate
470 470
      *
471 471
      * @return array
472 472
      */
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
     /**
497 497
      * Find query by method name.
498 498
      *
499
-     * @param $method
499
+     * @param string $method
500 500
      *
501 501
      * @return static
502 502
      */
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
      *
621 621
      * @throws \Exception
622 622
      *
623
-     * @return array
623
+     * @return string[]
624 624
      */
625 625
     protected function joinParameters(Relation $relation)
626 626
     {
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 
650 650
     /**
651 651
      * @param string $method
652
-     * @param array  $arguments
652
+     * @param integer[]  $arguments
653 653
      *
654 654
      * @return $this
655 655
      */
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 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
 
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         $this->setSort();
379 379
         $this->setPaginate();
380 380
 
381
-        $this->queries->unique()->each(function ($query) {
381
+        $this->queries->unique()->each(function($query) {
382 382
             $this->model = call_user_func_array([$this->model, $query['method']], $query['arguments']);
383 383
         });
384 384
 
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
 
409 409
         $queryBuilder = $this->originalModel;
410 410
 
411
-        $this->queries->reject(function ($query) {
411
+        $this->queries->reject(function($query) {
412 412
             return in_array($query['method'], ['get', 'paginate']);
413
-        })->each(function ($query) use (&$queryBuilder) {
413
+        })->each(function($query) use (&$queryBuilder) {
414 414
             $queryBuilder = $queryBuilder->{$query['method']}(...$query['arguments']);
415 415
         });
416 416
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
     {
445 445
         $paginate = $this->findQueryByMethod('paginate');
446 446
 
447
-        $this->queries = $this->queries->reject(function ($query) {
447
+        $this->queries = $this->queries->reject(function($query) {
448 448
             return $query['method'] == 'paginate';
449 449
         });
450 450
 
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
      */
503 503
     protected function findQueryByMethod($method)
504 504
     {
505
-        return $this->queries->first(function ($query) use ($method) {
505
+        return $this->queries->first(function($query) use ($method) {
506 506
             return $query['method'] == $method;
507 507
         });
508 508
     }
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
         }
526 526
 
527 527
         $columnNameContainsDots = Str::contains($columnName, '.');
528
-        $isRelation = $this->queries->contains(function ($query) use ($columnName) {
528
+        $isRelation = $this->queries->contains(function($query) use ($columnName) {
529 529
             list($relationName, $relationColumn) = explode('.', $columnName);
530 530
             return $query['method'] === 'with' && in_array($relationName, $query['arguments'], true);
531 531
         });
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
     {
573 573
         list($relationName, $relationColumn) = explode('.', $column);
574 574
 
575
-        if ($this->queries->contains(function ($query) use ($relationName) {
575
+        if ($this->queries->contains(function($query) use ($relationName) {
576 576
             return $query['method'] == 'with' && in_array($relationName, $query['arguments']);
577 577
         })) {
578 578
             $relation = $this->model->$relationName();
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
      */
607 607
     public function resetOrderBy()
608 608
     {
609
-        $this->queries = $this->queries->reject(function ($query) {
609
+        $this->queries = $this->queries->reject(function($query) {
610 610
             return $query['method'] == 'orderBy' || $query['method'] == 'orderByDesc';
611 611
         });
612 612
     }
Please login to merge, or discard this patch.