Completed
Pull Request — master (#3979)
by
unknown
07:34
created
src/Auth/Permission.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
      *
13 13
      * @param $permission
14 14
      *
15
-     * @return true
15
+     * @return boolean|null
16 16
      */
17 17
     public static function check($permission)
18 18
     {
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @param $roles
40 40
      *
41
-     * @return true
41
+     * @return boolean|null
42 42
      */
43 43
     public static function allow($roles)
44 44
     {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      *
67 67
      * @param $roles
68 68
      *
69
-     * @return true
69
+     * @return boolean|null
70 70
      */
71 71
     public static function deny($roles)
72 72
     {
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Auth;
4 4
 
5
-use Encore\Admin\Facades\Admin;
5
+use Encore\Admin\Facades\Admin;
6 6
 use Encore\Admin\Middleware\Pjax;
7 7
 
8 8
 class Permission
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
         }
22 22
 
23 23
         if (is_array($permission)) {
24
-            collect($permission)->each(function ($permission) {
24
+            collect($permission)->each(function($permission) {
25 25
                 call_user_func([self::class, 'check'], $permission);
26 26
             });
27 27
 
Please login to merge, or discard this patch.
src/Console/ActionCommand.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Illuminate\Console\GeneratorCommand;
5
+use Illuminate\Console\GeneratorCommand;
6 6
 use Illuminate\Support\Str;
7 7
 
8 8
 class ActionCommand extends GeneratorCommand
Please login to merge, or discard this patch.
src/Console/ExtendCommand.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Illuminate\Console\Command;
6
-use Illuminate\Filesystem\Filesystem;
5
+use Illuminate\Console\Command;
6
+use Illuminate\Filesystem\Filesystem;
7 7
 use Illuminate\Support\Str;
8 8
 
9 9
 class ExtendCommand extends Command
Please login to merge, or discard this patch.
src/Console/ImportCommand.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Encore\Admin\Admin;
6
-use Illuminate\Console\Command;
5
+use Encore\Admin\Admin;
6
+use Illuminate\Console\Command;
7 7
 use Illuminate\Support\Arr;
8 8
 
9 9
 class ImportCommand extends Command
Please login to merge, or discard this patch.
src/Console/MakeCommand.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     /**
36 36
      * Execute the console command.
37 37
      *
38
-     * @return void
38
+     * @return false|null
39 39
      */
40 40
     public function handle()
41 41
     {
Please login to merge, or discard this patch.
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Illuminate\Console\GeneratorCommand;
6
-use Illuminate\Database\Eloquent\Model;
5
+use Illuminate\Console\GeneratorCommand;
6
+use Illuminate\Database\Eloquent\Model;
7 7
 use Illuminate\Support\Str;
8 8
 
9 9
 class MakeCommand extends GeneratorCommand
Please login to merge, or discard this patch.
src/Console/MenuCommand.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Encore\Admin\Facades\Admin;
5
+use Encore\Admin\Facades\Admin;
6 6
 use Illuminate\Console\Command;
7 7
 
8 8
 class MenuCommand extends Command
Please login to merge, or discard this patch.
src/Console/MinifyCommand.php 2 patches
Unused Use Statements   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Encore\Admin\Admin;
6
-use Encore\Admin\Facades\Admin as AdminFacade;
7
-use Illuminate\Console\Command;
8
-use Illuminate\Support\Str;
5
+use Encore\Admin\Admin;
6
+use Encore\Admin\Facades\Admin as AdminFacade;
7
+use Illuminate\Console\Command;
8
+use Illuminate\Support\Str;
9 9
 use MatthiasMullie\Minify;
10 10
 
11 11
 class MinifyCommand extends Command
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     protected function minifyCSS()
95 95
     {
96 96
         $css = collect(array_merge(Admin::$css, Admin::baseCss()))
97
-            ->unique()->map(function ($css) {
97
+            ->unique()->map(function($css) {
98 98
                 if (url()->isValidUrl($css)) {
99 99
                     $this->assets['css'][] = $css;
100 100
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
     protected function minifyJS()
125 125
     {
126 126
         $js = collect(array_merge(Admin::$js, Admin::baseJs()))
127
-            ->unique()->map(function ($js) {
127
+            ->unique()->map(function($js) {
128 128
                 if (url()->isValidUrl($js)) {
129 129
                     $this->assets['js'][] = $js;
130 130
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
     protected function generateManifest()
155 155
     {
156
-        $min = collect(Admin::$min)->mapWithKeys(function ($path, $type) {
156
+        $min = collect(Admin::$min)->mapWithKeys(function($path, $type) {
157 157
             return [$type => sprintf('%s?id=%s', $path, md5(uniqid()))];
158 158
         });
159 159
 
Please login to merge, or discard this patch.
src/Console/PermissionCommand.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -112,6 +112,9 @@  discard block
 block discarded – undo
112 112
         ];
113 113
     }
114 114
 
115
+    /**
116
+     * @param string $permission
117
+     */
115 118
     private function generateHttpMethod($permission)
116 119
     {
117 120
         switch ($permission) {
@@ -134,6 +137,9 @@  discard block
 block discarded – undo
134 137
         return $http_method;
135 138
     }
136 139
 
140
+    /**
141
+     * @param string $permission
142
+     */
137 143
     private function generateHttpPath($table, $permission)
138 144
     {
139 145
         $resource = Str::kebab(Str::camel($table));
@@ -160,6 +166,9 @@  discard block
 block discarded – undo
160 166
         return $http_path;
161 167
     }
162 168
 
169
+    /**
170
+     * @param string $permission
171
+     */
163 172
     private function generateSlug($table, $permission)
164 173
     {
165 174
         return Str::kebab(Str::camel($table)).'.'.$permission;
Please login to merge, or discard this patch.
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Console;
4 4
 
5
-use Encore\Admin\Auth\Database\Permission;
6
-use Illuminate\Console\Command;
7
-use Illuminate\Support\Facades\DB;
5
+use Encore\Admin\Auth\Database\Permission;
6
+use Illuminate\Console\Command;
7
+use Illuminate\Support\Facades\DB;
8 8
 use Illuminate\Support\Str;
9 9
 
10 10
 class PermissionCommand extends Command
Please login to merge, or discard this patch.
src/Controllers/AdminController.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Encore\Admin\Controllers;
4 4
 
5
-use Encore\Admin\Layout\Content;
5
+use Encore\Admin\Layout\Content;
6 6
 use Illuminate\Routing\Controller;
7 7
 
8 8
 class AdminController extends Controller
Please login to merge, or discard this patch.