Completed
Pull Request — master (#4216)
by jxlwqq
02:27
created
src/Console/CreateUserCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         if (empty($selectedOption)) {
43 43
             $selected = $this->choice('Please choose a role for the user', $selectedOption, null, null, true);
44 44
 
45
-            $roles = $roles->filter(function ($role) use ($selected) {
45
+            $roles = $roles->filter(function($role) use ($selected) {
46 46
                 return in_array($role->name, $selected);
47 47
             });
48 48
         }
Please login to merge, or discard this patch.
src/Actions/GridAction.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-     * @return mixed
48
+     * @return string
49 49
      */
50 50
     protected function getModelClass()
51 51
     {
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
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
      *
282 282
      * @param string $column
283 283
      *
284
-     * @return mixed|string
284
+     * @return string
285 285
      */
286 286
     protected function formatColumn($column = '')
287 287
     {
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
     }
575 575
 
576 576
     /**
577
-     * @param string|array|Closure $input
577
+     * @param callable|null $input
578 578
      * @param string|array         $original
579 579
      *
580 580
      * @return array|Closure
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
     /**
786 786
      * Set or get value of the field.
787 787
      *
788
-     * @param null $value
788
+     * @param string $value
789 789
      *
790 790
      * @return mixed
791 791
      */
@@ -956,7 +956,7 @@  discard block
 block discarded – undo
956 956
     /**
957 957
      * Add html attributes to elements.
958 958
      *
959
-     * @param array|string $attribute
959
+     * @param string $attribute
960 960
      * @param mixed        $value
961 961
      *
962 962
      * @return $this
@@ -1334,7 +1334,7 @@  discard block
 block discarded – undo
1334 1334
     }
1335 1335
 
1336 1336
     /**
1337
-     * @param array $labelClass
1337
+     * @param string[] $labelClass
1338 1338
      *
1339 1339
      * @return self
1340 1340
      */
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
      *
1390 1390
      * @param string $view
1391 1391
      *
1392
-     * @return string
1392
+     * @return Field
1393 1393
      */
1394 1394
     public function setView($view): self
1395 1395
     {
Please login to merge, or discard this patch.
src/Controllers/UserController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -34,25 +34,25 @@  discard block
 block discarded – undo
34 34
         $grid->column('created_at', trans('admin.created_at'));
35 35
         $grid->column('updated_at', trans('admin.updated_at'));
36 36
         
37
-        $grid->filter(function (Grid\Filter $filter) {
37
+        $grid->filter(function(Grid\Filter $filter) {
38 38
             $roleModel = config('admin.database.roles_model');
39 39
             $filter->like('username', trans('admin.username'));
40 40
             $filter->like('name', trans('admin.name'));
41
-            $filter->where(function ($query) {
42
-                $query->whereHas('roles', function ($query) {
41
+            $filter->where(function($query) {
42
+                $query->whereHas('roles', function($query) {
43 43
                     $query->where('id', $this->input);
44 44
                 });
45 45
             }, trans('admin.roles'))->select($roleModel::all()->pluck('name', 'id'));
46 46
         });
47 47
 
48
-        $grid->actions(function (Grid\Displayers\Actions $actions) {
48
+        $grid->actions(function(Grid\Displayers\Actions $actions) {
49 49
             if ($actions->getKey() == 1) {
50 50
                 $actions->disableDelete();
51 51
             }
52 52
         });
53 53
 
54
-        $grid->tools(function (Grid\Tools $tools) {
55
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
54
+        $grid->tools(function(Grid\Tools $tools) {
55
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
56 56
                 $actions->disableDelete();
57 57
             });
58 58
         });
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
         $show->field('id', 'ID');
77 77
         $show->field('username', trans('admin.username'));
78 78
         $show->field('name', trans('admin.name'));
79
-        $show->field('roles', trans('admin.roles'))->as(function ($roles) {
79
+        $show->field('roles', trans('admin.roles'))->as(function($roles) {
80 80
             return $roles->pluck('name');
81 81
         })->label();
82
-        $show->field('permissions', trans('admin.permissions'))->as(function ($permission) {
82
+        $show->field('permissions', trans('admin.permissions'))->as(function($permission) {
83 83
             return $permission->pluck('name');
84 84
         })->label();
85 85
         $show->field('created_at', trans('admin.created_at'));
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $form->image('avatar', trans('admin.avatar'));
114 114
         $form->password('password', trans('admin.password'))->rules('required|confirmed');
115 115
         $form->password('password_confirmation', trans('admin.password_confirmation'))->rules('required')
116
-            ->default(function ($form) {
116
+            ->default(function($form) {
117 117
                 return $form->model()->password;
118 118
             });
119 119
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
         $form->display('created_at', trans('admin.created_at'));
126 126
         $form->display('updated_at', trans('admin.updated_at'));
127 127
 
128
-        $form->saving(function (Form $form) {
128
+        $form->saving(function(Form $form) {
129 129
             if ($form->password && $form->model()->password != $form->password) {
130 130
                 $form->password = bcrypt($form->password);
131 131
             }
Please login to merge, or discard this patch.
src/Controllers/RoleController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,25 +36,25 @@  discard block
 block discarded – undo
36 36
         $grid->column('created_at', trans('admin.created_at'));
37 37
         $grid->column('updated_at', trans('admin.updated_at'));
38 38
         
39
-        $grid->filter(function (Grid\Filter $filter) {
39
+        $grid->filter(function(Grid\Filter $filter) {
40 40
             $permissionModel = config('admin.database.permissions_model');
41 41
             $filter->like('slug', trans('admin.slug'));
42 42
             $filter->like('name', trans('admin.name'));
43
-            $filter->where(function ($query) {
44
-                $query->whereHas('permissions', function ($query) {
43
+            $filter->where(function($query) {
44
+                $query->whereHas('permissions', function($query) {
45 45
                     $query->where('id', $this->input);
46 46
                 });
47 47
             }, trans('admin.permissions'))->select($permissionModel::all()->pluck('name', 'id'));
48 48
         });
49 49
 
50
-        $grid->actions(function (Grid\Displayers\Actions $actions) {
50
+        $grid->actions(function(Grid\Displayers\Actions $actions) {
51 51
             if ($actions->row->slug == 'administrator') {
52 52
                 $actions->disableDelete();
53 53
             }
54 54
         });
55 55
 
56
-        $grid->tools(function (Grid\Tools $tools) {
57
-            $tools->batch(function (Grid\Tools\BatchActions $actions) {
56
+        $grid->tools(function(Grid\Tools $tools) {
57
+            $tools->batch(function(Grid\Tools\BatchActions $actions) {
58 58
                 $actions->disableDelete();
59 59
             });
60 60
         });
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $show->field('id', 'ID');
79 79
         $show->field('slug', trans('admin.slug'));
80 80
         $show->field('name', trans('admin.name'));
81
-        $show->field('permissions', trans('admin.permissions'))->as(function ($permission) {
81
+        $show->field('permissions', trans('admin.permissions'))->as(function($permission) {
82 82
             return $permission->pluck('name');
83 83
         })->label();
84 84
         $show->field('created_at', trans('admin.created_at'));
Please login to merge, or discard this patch.