Completed
Pull Request — master (#3065)
by
unknown
02:22
created
src/Form/Field/Embeds.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
     {
12 12
         return call_user_func_array(
13 13
             'array_merge',
14
-            array_map(function ($u, $v) use ($b, $c) {
14
+            array_map(function($u, $v) use ($b, $c) {
15 15
                 return ["{$b}{$c}{$u}" => $v];
16 16
             }, array_keys($a), array_values($a))
17 17
         );
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 if (!function_exists('array_key_clean')) {
44 44
     function array_key_clean(array $a)
45 45
     {
46
-        $a = count($a) ? call_user_func_array('array_merge', array_map(function ($k, $v) {
46
+        $a = count($a) ? call_user_func_array('array_merge', array_map(function($k, $v) {
47 47
             return [str_replace(':', '', $k) => $v];
48 48
         }, array_keys($a), array_values($a))) : $a;
49 49
 
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
              *      'extra.end_atend'     => "$label[end_at]"
157 157
              * ]
158 158
              */
159
-            $newColumn = array_map(function ($k, $v) use ($rel) {
159
+            $newColumn = array_map(function($k, $v) use ($rel) {
160 160
                 //Fix ResetInput Function! A Headache Implementation!
161 161
                 return !$k ? "{$rel}.{$v}" : "{$rel}.{$v}:{$k}";
162 162
             }, array_keys($columns), array_values($columns));
163 163
 
164 164
             $fieldRules = is_array($fieldRules) ? implode('|', $fieldRules) : $fieldRules;
165
-            $newRules = array_map(function ($v) use ($fieldRules, $availInput) {
165
+            $newRules = array_map(function($v) use ($fieldRules, $availInput) {
166 166
                 list($k, $c) = explode('.', $v);
167 167
                 //Fix ResetInput Function! A Headache Implementation!
168 168
                 $col = explode(':', $c)[0];
@@ -243,20 +243,20 @@  discard block
 block discarded – undo
243 243
              *      'extra.end_atend'     => "$label[end_at]"
244 244
              * ]
245 245
              */
246
-            $newColumn = array_map(function ($k, $v) use ($rel) {
246
+            $newColumn = array_map(function($k, $v) use ($rel) {
247 247
                 //Fix ResetInput Function! A Headache Implementation!
248 248
                 return !$k ? "{$rel}.{$v}" : "{$rel}.{$v}:{$k}";
249 249
             }, array_keys($columns), array_values($columns));
250 250
 
251
-            $newAttributes = array_map(function ($v) use ($field, $availInput) {
251
+            $newAttributes = array_map(function($v) use ($field, $availInput) {
252 252
                 list($k, $c) = explode('.', $v);
253 253
                 //Fix ResetInput Function! A Headache Implementation!
254 254
                 $col = explode(':', $c)[0];
255 255
                 if (array_key_exists($col, $availInput[$k]) && is_array($availInput[$k][$col])) {
256
-                    return call_user_func_array('array_merge', array_map(function ($u) use ($v, $field) {
256
+                    return call_user_func_array('array_merge', array_map(function($u) use ($v, $field) {
257 257
                         $w = $field->label();
258 258
                         //Fix ResetInput Function! A Headache Implementation!
259
-                        $w .= is_array($field->column()) ? '[' . explode(':', explode('.', $v)[2])[0] . ']' : '';
259
+                        $w .= is_array($field->column()) ? '['.explode(':', explode('.', $v)[2])[0].']' : '';
260 260
 
261 261
                         return ["{$v}:{$u}" => $w];
262 262
                     }, array_keys($availInput[$k][$col])));
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                 //May Have Problem in Dealing with File Upload in Edit Mode
266 266
                 $w = $field->label();
267 267
                 //Fix ResetInput Function! A Headache Implementation!
268
-                $w .= is_array($field->column()) ? '[' . explode(':', explode('.', $v)[2])[0] . ']' : '';
268
+                $w .= is_array($field->column()) ? '['.explode(':', explode('.', $v)[2])[0].']' : '';
269 269
 
270 270
                 return [$v => $w];
271 271
             }, $newColumn);
@@ -332,12 +332,12 @@  discard block
 block discarded – undo
332 332
              *     'extra.end_atend' => $value
333 333
              * ]
334 334
              */
335
-            $newColumn = array_map(function ($k, $v) use ($rel) {
335
+            $newColumn = array_map(function($k, $v) use ($rel) {
336 336
                 //Fix ResetInput Function! A Headache Implementation!
337 337
                 return !$k ? "{$rel}.{$v}" : "{$rel}.{$v}:{$k}";
338 338
             }, array_keys($columns), array_values($columns));
339 339
 
340
-            $newInput = array_map(function ($v) use ($availInput) {
340
+            $newInput = array_map(function($v) use ($availInput) {
341 341
                 list($k, $c) = explode('.', $v);
342 342
                 //Fix ResetInput Function! A Headache Implementation!
343 343
                 $col = explode(':', $c)[0];
@@ -395,20 +395,20 @@  discard block
 block discarded – undo
395 395
                 $availInput[$column] = $availInput[$column] ?: null;
396 396
             }
397 397
 
398
-            $newColumn = array_map(function ($k, $v) use ($rel) {
398
+            $newColumn = array_map(function($k, $v) use ($rel) {
399 399
                 //Fix ResetInput Function! A Headache Implementation!
400 400
                 return !$k ? "{$rel}.{$v}" : "{$rel}.{$v}:{$k}";
401 401
             }, array_keys($columns), array_values($columns));
402 402
 
403 403
             if ($field->validationMessages) {
404
-                $newMessages = array_map(function ($v) use ($field, $availInput) {
404
+                $newMessages = array_map(function($v) use ($field, $availInput) {
405 405
                     list($k, $c) = explode('.', $v);
406 406
                     //Fix ResetInput Function! A Headache Implementation!
407 407
                     $col = explode(':', $c)[0];
408 408
                     if (array_key_exists($col, $availInput[$k]) && is_array($availInput[$k][$col])) {
409 409
                         return call_user_func_array(
410 410
                             'array_merge',
411
-                            array_map(function ($u) use (
411
+                            array_map(function($u) use (
412 412
                                 $v,
413 413
                                 $field
414 414
                             ) {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             return json_decode($this->value, true);
477 477
         }
478 478
 
479
-        return (array)$this->value;
479
+        return (array) $this->value;
480 480
     }
481 481
 
482 482
     /**
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
         //Fix the Bug of Embeds Fields Cannot be used within HasMany
496 496
         if ($this->elementName) {
497 497
             list($rel, $key, $col) = explode('.', $this->errorKey);
498
-            $form->fields()->each(function (Field $field) use ($rel, $key, $col) {
498
+            $form->fields()->each(function(Field $field) use ($rel, $key, $col) {
499 499
                 $column = $field->column();
500 500
                 $elementName = $elementClass = $errorKey = [];
501 501
                 if (is_array($column)) {
Please login to merge, or discard this patch.
src/Grid.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      * Get or set option for grid.
251 251
      *
252 252
      * @param string $key
253
-     * @param mixed  $value
253
+     * @param boolean  $value
254 254
      *
255 255
      * @return $this|mixed
256 256
      */
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
     /**
441 441
      * Get the grid paginator.
442 442
      *
443
-     * @return mixed
443
+     * @return Tools\Paginator
444 444
      */
445 445
     public function paginator()
446 446
     {
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
      *
623 623
      * @param bool $toArray
624 624
      *
625
-     * @return array|Collection|mixed
625
+     * @return Collection
626 626
      */
627 627
     public function processFilter($toArray = true)
628 628
     {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
      *
873 873
      * @param Closure|null $closure
874 874
      *
875
-     * @return $this|Closure
875
+     * @return callable
876 876
      */
877 877
     public function header(Closure $closure = null)
878 878
     {
@@ -904,7 +904,7 @@  discard block
 block discarded – undo
904 904
      *
905 905
      * @param Closure|null $closure
906 906
      *
907
-     * @return $this|Closure
907
+     * @return callable
908 908
      */
909 909
     public function footer(Closure $closure = null)
910 910
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
         array_push($visible, '__row_selector__', '__actions__');
373 373
 
374
-        return $this->columns->filter(function (Column $column) use ($visible) {
374
+        return $this->columns->filter(function(Column $column) use ($visible) {
375 375
             return in_array($column->getName(), $visible);
376 376
         });
377 377
     }
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 
392 392
         array_push($visible, '__row_selector__', '__actions__');
393 393
 
394
-        return collect($this->columnNames)->filter(function ($column) use ($visible) {
394
+        return collect($this->columnNames)->filter(function($column) use ($visible) {
395 395
             return in_array($column, $visible);
396 396
         });
397 397
     }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
         $column = new Column($column, $label);
410 410
         $column->setGrid($this);
411 411
 
412
-        return tap($column, function ($value) {
412
+        return tap($column, function($value) {
413 413
             $this->columns->push($value);
414 414
         });
415 415
     }
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
         $column = new Column($column, $label);
428 428
         $column->setGrid($this);
429 429
 
430
-        return tap($column, function ($value) {
430
+        return tap($column, function($value) {
431 431
             $this->columns->prepend($value);
432 432
         });
433 433
     }
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
 
585 585
         Column::setOriginalGridModels($collection);
586 586
 
587
-        $this->columns->map(function (Column $column) use (&$data) {
587
+        $this->columns->map(function(Column $column) use (&$data) {
588 588
             $data = $column->fill($data);
589 589
 
590 590
             $this->columnNames[] = $column->getName();
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
      */
689 689
     protected function buildRows(array $data)
690 690
     {
691
-        $this->rows = collect($data)->map(function ($model, $number) {
691
+        $this->rows = collect($data)->map(function($model, $number) {
692 692
             return new Row($number, $model);
693 693
         });
694 694
 
Please login to merge, or discard this patch.
src/Layout/Column.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
     protected function startColumn()
113 113
     {
114 114
         // get class name using width array
115
-        $classnName = collect($this->width)->map(function ($value, $key) {
115
+        $classnName = collect($this->width)->map(function($value, $key) {
116 116
             return "col-$key-$value";
117 117
         })->implode(' ');
118 118
 
Please login to merge, or discard this patch.
src/Form/Field.php 1 patch
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     /**
223 223
      * Field constructor.
224 224
      *
225
-     * @param       $column
225
+     * @param       string $column
226 226
      * @param array $arguments
227 227
      */
228 228
     public function __construct($column, $arguments = [])
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
     /**
557 557
      * Set or get value of the field.
558 558
      *
559
-     * @param null $value
559
+     * @param string $value
560 560
      *
561 561
      * @return mixed
562 562
      */
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
     /**
728 728
      * Add html attributes to elements.
729 729
      *
730
-     * @param array|string $attribute
730
+     * @param string $attribute
731 731
      * @param mixed        $value
732 732
      *
733 733
      * @return $this
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
     }
1020 1020
 
1021 1021
     /**
1022
-     * @param array $labelClass
1022
+     * @param string[] $labelClass
1023 1023
      *
1024 1024
      * @return self
1025 1025
      */
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
     /**
1073 1073
      * Set view of current field.
1074 1074
      *
1075
-     * @return string
1075
+     * @return Field
1076 1076
      */
1077 1077
     public function setView($view)
1078 1078
     {
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
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         $this->setupScript($show, $columns);
40 40
 
41
-        $lists = $columns->map(function ($val, $key) use ($show) {
41
+        $lists = $columns->map(function($val, $key) use ($show) {
42 42
             if (empty($show)) {
43 43
                 $checked = 'checked';
44 44
             } else {
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     protected function getGridColumns()
75 75
     {
76
-        return $this->grid->columns()->map(function (Grid\Column $column) {
76
+        return $this->grid->columns()->map(function(Grid\Column $column) {
77 77
             $name = $column->getName();
78 78
 
79 79
             if (in_array($name, ['__row_selector__', '__actions__'])) {
Please login to merge, or discard this patch.
src/Grid/Tools.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function disableFilterButton(bool $disable = true)
87 87
     {
88
-        $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) {
88
+        $this->tools = $this->tools->map(function(AbstractTool $tool) use ($disable) {
89 89
             if ($tool instanceof FilterButton) {
90 90
                 return $tool->disable($disable);
91 91
             }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function disableRefreshButton(bool $disable = true)
102 102
     {
103
-        $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) {
103
+        $this->tools = $this->tools->map(function(AbstractTool $tool) use ($disable) {
104 104
             if ($tool instanceof RefreshButton) {
105 105
                 return $tool->disable($disable);
106 106
             }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function disableBatchActions(bool $disable = true)
117 117
     {
118
-        $this->tools = $this->tools->map(function ($tool) use ($disable) {
118
+        $this->tools = $this->tools->map(function($tool) use ($disable) {
119 119
             if ($tool instanceof BatchActions) {
120 120
                 return $tool->disable($disable);
121 121
             }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function batch(\Closure $closure)
130 130
     {
131
-        call_user_func($closure, $this->tools->first(function ($tool) {
131
+        call_user_func($closure, $this->tools->first(function($tool) {
132 132
             return $tool instanceof BatchActions;
133 133
         }));
134 134
     }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     public function render()
142 142
     {
143
-        return $this->tools->map(function ($tool) {
143
+        return $this->tools->map(function($tool) {
144 144
             if ($tool instanceof AbstractTool) {
145 145
                 if (!$tool->allowed()) {
146 146
                     return '';
Please login to merge, or discard this patch.