Passed
Pull Request — master (#39)
by Arjay
15:07 queued 05:40
created
src/Traits/RefreshCache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 {
9 9
     public static function bootRefreshCache()
10 10
     {
11
-        static::saved(function () {
11
+        static::saved(function() {
12 12
             if (auth()->check()) {
13 13
                 auth()->user()->load('roles');
14 14
             }
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             app(GateRegistrar::class)->register();
18 18
         });
19 19
 
20
-        static::deleted(function () {
20
+        static::deleted(function() {
21 21
             if (auth()->check()) {
22 22
                 auth()->user()->load('roles');
23 23
             }
Please login to merge, or discard this patch.
src/Traits/InteractsWithPermission.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $this->getPermissionClass()
24 24
             ->newQuery()
25 25
             ->whereIn('slug', (array) $slug)
26
-            ->each(function ($permission) {
26
+            ->each(function($permission) {
27 27
                 $this->grantPermission($permission);
28 28
             });
29 29
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $this->getPermissionClass()
65 65
             ->newQuery()
66 66
             ->whereIn('resource', (array) $resource)
67
-            ->each(function ($permission) {
67
+            ->each(function($permission) {
68 68
                 $this->grantPermission($permission);
69 69
             });
70 70
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      * @param  bool  $touch
80 80
      * @return void
81 81
      */
82
-    public function grantPermission($id, array $attributes = [], $touch = true)
82
+    public function grantPermission($id, array $attributes = [ ], $touch = true)
83 83
     {
84 84
         $this->permissions()->attach($id, $attributes, $touch);
85 85
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $this->getPermissionClass()
97 97
             ->newQuery()
98 98
             ->whereIn('slug', (array) $slug)
99
-            ->each(function ($permission) {
99
+            ->each(function($permission) {
100 100
                 $this->revokePermission($permission);
101 101
             });
102 102
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $this->getPermissionClass()
114 114
             ->newQuery()
115 115
             ->whereIn('resource', (array) $resource)
116
-            ->each(function ($permission) {
116
+            ->each(function($permission) {
117 117
                 $this->revokePermission($permission);
118 118
             });
119 119
 
Please login to merge, or discard this patch.
src/Traits/InteractsWithRole.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param  array  $attributes
65 65
      * @param  bool  $touch
66 66
      */
67
-    public function attachRole($role, array $attributes = [], $touch = true)
67
+    public function attachRole($role, array $attributes = [ ], $touch = true)
68 68
     {
69 69
         $this->roles()->attach($role, $attributes, $touch);
70 70
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     public function scopeHavingRoles(Builder $query, $roles): Builder
118 118
     {
119
-        return $query->whereExists(function ($query) use ($roles) {
119
+        return $query->whereExists(function($query) use ($roles) {
120 120
             $query->selectRaw('1')
121 121
                 ->from('role_user')
122 122
                 ->whereRaw('role_user.user_id = users.id')
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     public function scopeHavingRolesBySlugs(Builder $query, $slugs): Builder
135 135
     {
136
-        return $query->whereHas('roles', function ($query) use ($slugs) {
136
+        return $query->whereHas('roles', function($query) use ($slugs) {
137 137
             $query->whereIn('roles.slug', $slugs);
138 138
         });
139 139
     }
Please login to merge, or discard this patch.
src/Traits/HasRole.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,10 +59,10 @@
 block discarded – undo
59 59
      */
60 60
     public function getPermissions(): array
61 61
     {
62
-        $permissions = [[], []];
62
+        $permissions = [ [ ], [ ] ];
63 63
 
64 64
         foreach ($this->roles as $role) {
65
-            $permissions[] = $role->getPermissions();
65
+            $permissions[ ] = $role->getPermissions();
66 66
         }
67 67
 
68 68
         return call_user_func_array('array_merge', $permissions);
Please login to merge, or discard this patch.
src/GateRegistrar.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function register()
40 40
     {
41
-        $this->getPermissions()->each(function ($permission) {
41
+        $this->getPermissions()->each(function($permission) {
42 42
             $ability = $permission->slug;
43
-            $policy = function ($user) use ($permission) {
43
+            $policy = function($user) use ($permission) {
44 44
                 return collect($user->getPermissions())->contains($permission->slug);
45 45
             };
46 46
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $key = config('acl.cache.key', 'permissions.policies');
64 64
         try {
65 65
             if (config('acl.cache.enabled', true)) {
66
-                return $this->cache->rememberForever($key, function () {
66
+                return $this->cache->rememberForever($key, function() {
67 67
                     return $this->getPermissionClass()->with('roles')->get();
68 68
                 });
69 69
             } else {
Please login to merge, or discard this patch.