Completed
Pull Request — master (#3266)
by jxlwqq
02:40
created
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 ($tool) use ($disable) {
88
+        $this->tools = $this->tools->map(function($tool) use ($disable) {
89 89
             if ($tool instanceof FilterButton) {
90 90
                 return $tool->disable($disable);
91 91
             }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function disableRefreshButton(bool $disable = true)
103 103
     {
104
-        $this->tools = $this->tools->map(function (AbstractTool $tool) use ($disable) {
104
+        $this->tools = $this->tools->map(function(AbstractTool $tool) use ($disable) {
105 105
             if ($tool instanceof RefreshButton) {
106 106
                 return $tool->disable($disable);
107 107
             }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function disableBatchActions(bool $disable = true)
119 119
     {
120
-        $this->tools = $this->tools->map(function ($tool) use ($disable) {
120
+        $this->tools = $this->tools->map(function($tool) use ($disable) {
121 121
             if ($tool instanceof BatchActions) {
122 122
                 return $tool->disable($disable);
123 123
             }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function batch(\Closure $closure)
133 133
     {
134
-        call_user_func($closure, $this->tools->first(function ($tool) {
134
+        call_user_func($closure, $this->tools->first(function($tool) {
135 135
             return $tool instanceof BatchActions;
136 136
         }));
137 137
     }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public function render()
145 145
     {
146
-        return $this->tools->map(function ($tool) {
146
+        return $this->tools->map(function($tool) {
147 147
             if ($tool instanceof AbstractTool) {
148 148
                 if (!$tool->allowed()) {
149 149
                     return '';
Please login to merge, or discard this patch.
src/Middleware/Permission.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
             return $next($request);
34 34
         }
35 35
 
36
-        if (!Admin::user()->allPermissions()->first(function ($permission) use ($request) {
36
+        if (!Admin::user()->allPermissions()->first(function($permission) use ($request) {
37 37
             return $permission->shouldPassThrough($request);
38 38
         })) {
39 39
             Checker::error();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      */
53 53
     public function checkRoutePermission(Request $request)
54 54
     {
55
-        if (!$middleware = collect($request->route()->middleware())->first(function ($middleware) {
55
+        if (!$middleware = collect($request->route()->middleware())->first(function($middleware) {
56 56
             return Str::startsWith($middleware, $this->middlewarePrefix);
57 57
         })) {
58 58
             return false;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         return collect($excepts)
89 89
             ->map('admin_base_path')
90
-            ->contains(function ($except) use ($request) {
90
+            ->contains(function($except) use ($request) {
91 91
                 if ($except !== '/') {
92 92
                     $except = trim($except, '/');
93 93
                 }
Please login to merge, or discard this patch.
src/Middleware/Authenticate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 
44 44
         return collect($excepts)
45 45
             ->map('admin_base_path')
46
-            ->contains(function ($except) use ($request) {
46
+            ->contains(function($except) use ($request) {
47 47
                 if ($except !== '/') {
48 48
                     $except = trim($except, '/');
49 49
                 }
Please login to merge, or discard this patch.
src/Form/Field.php 1 patch
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     /**
228 228
      * Field constructor.
229 229
      *
230
-     * @param       $column
230
+     * @param       string $column
231 231
      * @param array $arguments
232 232
      */
233 233
     public function __construct($column, $arguments = [])
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
     /**
564 564
      * Set or get value of the field.
565 565
      *
566
-     * @param null $value
566
+     * @param string $value
567 567
      *
568 568
      * @return mixed
569 569
      */
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
     /**
735 735
      * Add html attributes to elements.
736 736
      *
737
-     * @param array|string $attribute
737
+     * @param string $attribute
738 738
      * @param mixed        $value
739 739
      *
740 740
      * @return $this
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
     /**
1021 1021
      * Get element class.
1022 1022
      *
1023
-     * @return array
1023
+     * @return string
1024 1024
      */
1025 1025
     protected function getGroupClass($default = false)
1026 1026
     : string
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
     }
1070 1070
 
1071 1071
     /**
1072
-     * @param array $labelClass
1072
+     * @param string[] $labelClass
1073 1073
      *
1074 1074
      * @return self
1075 1075
      */
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
     /**
1123 1123
      * Set view of current field.
1124 1124
      *
1125
-     * @return string
1125
+     * @return Field
1126 1126
      */
1127 1127
     public function setView($view)
1128 1128
     {
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
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
         $this->setupScript();
43 43
 
44
-        $lists = $columns->map(function ($val, $key) use ($show) {
44
+        $lists = $columns->map(function($val, $key) use ($show) {
45 45
             if (empty($show)) {
46 46
                 $checked = 'checked';
47 47
             } else {
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function getGridColumns()
94 94
     {
95
-        return $this->grid->columns()->map(function (Grid\Column $column) {
95
+        return $this->grid->columns()->map(function(Grid\Column $column) {
96 96
             $name = $column->getName();
97 97
 
98 98
             if (in_array($name, ['__row_selector__', '__actions__'])) {
Please login to merge, or discard this patch.
src/Grid/Exporters/ExcelExporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
             $eagerLoads = array_keys($this->getQuery()->getEagerLoads());
51 51
 
52
-            $columns = collect($columns)->reject(function ($column) use ($eagerLoads) {
52
+            $columns = collect($columns)->reject(function($column) use ($eagerLoads) {
53 53
                 return Str::contains($column, '.') || in_array($column, $eagerLoads);
54 54
             });
55 55
 
Please login to merge, or discard this patch.
src/Grid/Exporters/CsvExporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
             'Content-Disposition' => "attachment; filename=\"$filename\"",
23 23
         ];
24 24
 
25
-        response()->stream(function () {
25
+        response()->stream(function() {
26 26
             $handle = fopen('php://output', 'w');
27 27
 
28 28
             $titles = [];
29 29
 
30
-            $this->chunk(function ($records) use ($handle, &$titles) {
30
+            $this->chunk(function($records) use ($handle, &$titles) {
31 31
                 if (empty($titles)) {
32 32
                     $titles = $this->getHeaderRowFromRecords($records);
33 33
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     public function getHeaderRowFromRecords(Collection $records): array
56 56
     {
57 57
         $titles = collect(Arr::dot($records->first()->toArray()))->keys()->map(
58
-            function ($key) {
58
+            function($key) {
59 59
                 $key = str_replace('.', ' ', $key);
60 60
 
61 61
                 return Str::ucfirst($key);
Please login to merge, or discard this patch.
src/Grid/Displayers/Table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             $columns = $titles;
24 24
         }
25 25
 
26
-        $data = array_map(function ($item) use ($columns) {
26
+        $data = array_map(function($item) use ($columns) {
27 27
             $sorted = [];
28 28
 
29 29
             $arr = Arr::only($item, $columns);
Please login to merge, or discard this patch.
src/Grid/Filter/Between.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 
66 66
         $this->value = Arr::get($inputs, $this->column);
67 67
 
68
-        $value = array_filter($this->value, function ($val) {
68
+        $value = array_filter($this->value, function($val) {
69 69
             return $val !== '';
70 70
         });
71 71
 
Please login to merge, or discard this patch.