Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#7)
by
unknown
02:44
created
src/Console/Commands/PermissionGeneratorBackpackCommand.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Backpack\Generators\Console\Commands;
4 4
 
5
-use Artisan;
6 5
 use Illuminate\Console\Command;
7 6
 use Spatie\Permission\Models\Permission;
8 7
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,28 +30,28 @@  discard block
 block discarded – undo
30 30
     public function handle()
31 31
     {
32 32
         $routeName         = $this->argument('route');
33
-        $permissions       = ['list', 'create', 'update', 'reorder', 'delete'];
33
+        $permissions       = [ 'list', 'create', 'update', 'reorder', 'delete' ];
34 34
         $permissionsAdded  = 0;
35 35
         $customPermissions = $this->option('permission');
36 36
 
37
-        if( count($customPermissions) > 0 ){
37
+        if (count($customPermissions) > 0) {
38 38
             $permissions = $customPermissions;
39 39
         }
40 40
 
41 41
         $bar = $this->output->createProgressBar(count($permissions));
42 42
 
43
-        foreach($permissions as $permission){
43
+        foreach ($permissions as $permission) {
44 44
 
45
-            $permissionName = trim($routeName, '/') . '/' . trim($permission, '/');
45
+            $permissionName = trim($routeName, '/').'/'.trim($permission, '/');
46 46
             $permissionName = strtolower($permissionName);
47 47
 
48
-            $existingPermission = Permission::where(['name' => $permissionName])->first();
48
+            $existingPermission = Permission::where([ 'name' => $permissionName ])->first();
49 49
 
50
-            if( $existingPermission ){
50
+            if ($existingPermission) {
51 51
 
52 52
                 $continueAdding = $this->confirm("$permissionName already exists, do you want to carry on? [y|N]");
53 53
 
54
-                if( $continueAdding ){
54
+                if ($continueAdding) {
55 55
                     $bar->setMessage("Skipping $permissionName");
56 56
                     $bar->advance();
57 57
                     continue;
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
                 }
63 63
             }
64 64
             else {
65
-                $newPermission = Permission::create(['name' => $permissionName]);
65
+                $newPermission = Permission::create([ 'name' => $permissionName ]);
66 66
                 $newPermission->save();
67 67
 
68
-                if( $newPermission->id ){
68
+                if ($newPermission->id) {
69 69
                     $permissionsAdded++;
70 70
                     $bar->setMessage("$newPermission->name added with ID: $newPermission->id");
71 71
                     $bar->advance();
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -55,13 +55,11 @@  discard block
 block discarded – undo
55 55
                     $bar->setMessage("Skipping $permissionName");
56 56
                     $bar->advance();
57 57
                     continue;
58
-                }
59
-                else {
58
+                } else {
60 59
                     $bar->finish();
61 60
                     return $this->error("\nCancelled adding any more permissions.");
62 61
                 }
63
-            }
64
-            else {
62
+            } else {
65 63
                 $newPermission = Permission::create(['name' => $permissionName]);
66 64
                 $newPermission->save();
67 65
 
@@ -69,8 +67,7 @@  discard block
 block discarded – undo
69 67
                     $permissionsAdded++;
70 68
                     $bar->setMessage("$newPermission->name added with ID: $newPermission->id");
71 69
                     $bar->advance();
72
-                }
73
-                else {
70
+                } else {
74 71
                     $bar->setMessage("$permissionName could not be created.");
75 72
                     $bar->advance();
76 73
                 }
Please login to merge, or discard this patch.