Passed
Pull Request — master (#14)
by ARCANEDEV
08:28
created
src/Auth/Views/Components/RolesDatatable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,10 +75,10 @@
 block discarded – undo
75 75
     {
76 76
         return $repo
77 77
             ->withCount(['administrators'])
78
-            ->unless(empty($this->search), function (Builder $query) {
78
+            ->unless(empty($this->search), function(Builder $query) {
79 79
                 $query->where('name', 'like', '%'.$this->search.'%');
80 80
             })
81
-            ->unless(empty($this->sortField), function (Builder $query) {
81
+            ->unless(empty($this->sortField), function(Builder $query) {
82 82
                 $query->orderBy($this->sortField, $this->getSortDirection());
83 83
             })
84 84
             ->paginate($this->perPage);
Please login to merge, or discard this patch.
src/Auth/Models/Presenters/PermissionPresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public function getUsersCountAttribute(): int
32 32
     {
33
-        return $this->roles->sum(function (Role $role) {
33
+        return $this->roles->sum(function(Role $role) {
34 34
             return $role->administrators->count();
35 35
         });
36 36
     }
Please login to merge, or discard this patch.
src/Auth/Models/Presenters/AuthenticatablePresenter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
         $show  = 2;
97 97
         $parts = explode('@', $this->email);
98 98
 
99
-        return substr($parts[0],0, $show).str_repeat('*', 3).'@'.$parts[1];
99
+        return substr($parts[0], 0, $show).str_repeat('*', 3).'@'.$parts[1];
100 100
     }
101 101
 
102 102
     /**
Please login to merge, or discard this patch.
src/Auth/Models/Administrator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         return $this->active_roles
166 166
             ->pluck('permissions')
167 167
             ->flatten()
168
-            ->unique(function (Permission $permission) {
168
+            ->unique(function(Permission $permission) {
169 169
                 return $permission->getKey();
170 170
             });
171 171
     }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      */
210 210
     public function may($ability): bool
211 211
     {
212
-        return $this->permissions->filter(function (Permission $permission) use ($ability) {
212
+        return $this->permissions->filter(function(Permission $permission) use ($ability) {
213 213
             return $permission->hasAbility($ability);
214 214
         })->isNotEmpty();
215 215
     }
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             ? $permissions
229 229
             : $this->newCollection($permissions);
230 230
 
231
-        $failed = $permissions->reject(function ($permission) {
231
+        $failed = $permissions->reject(function($permission) {
232 232
             return $this->may($permission);
233 233
         })->values();
234 234
 
Please login to merge, or discard this patch.
src/Auth/Models/Concerns/HasRoles.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function getActiveRolesAttribute()
44 44
     {
45
-        return $this->roles->filter(function (Role $role) {
45
+        return $this->roles->filter(function(Role $role) {
46 46
             return $role->isActive();
47 47
         });
48 48
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     {
94 94
         $roles = is_array($roles) ? new Collection($roles) : $roles;
95 95
 
96
-        $failed = $roles->reject(function ($role) {
96
+        $failed = $roles->reject(function($role) {
97 97
             return $this->hasRoleKey($role);
98 98
         })->values();
99 99
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function hasRoleKey(string $key): bool
111 111
     {
112
-        return $this->active_roles->filter(function (Role $role) use ($key) {
112
+        return $this->active_roles->filter(function(Role $role) use ($key) {
113 113
             return $role->hasKey($key);
114 114
         })->isNotEmpty();
115 115
     }
Please login to merge, or discard this patch.
src/Auth/Models/Role.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function scopeFilterByAuthenticatedAdministrator(Builder $query, Administrator $administrator): Builder
167 167
     {
168
-        return $query->unless($administrator->isSuperAdmin(), function (Builder $q) {
168
+        return $query->unless($administrator->isSuperAdmin(), function(Builder $q) {
169 169
             $q->where('key', '!=', static::ADMINISTRATOR);
170 170
         });
171 171
     }
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         if ( ! $this->isActive())
370 370
             return false;
371 371
 
372
-        return $this->permissions->filter(function (Permission $permission) use ($ability) {
372
+        return $this->permissions->filter(function(Permission $permission) use ($ability) {
373 373
             return $permission->hasAbility($ability);
374 374
         })->first() !== null;
375 375
     }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     {
387 387
         $permissions = is_array($permissions) ? collect($permissions) : $permissions;
388 388
 
389
-        $failed = $permissions->reject(function ($permission) {
389
+        $failed = $permissions->reject(function($permission) {
390 390
             return $this->can($permission);
391 391
         })->values();
392 392
 
Please login to merge, or discard this patch.
src/Auth/Metrics/Roles/TotalUsersByRoles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     public function calculate(Request $request, RolesRepository $repo)
35 35
     {
36 36
         // Calculate roles with users count
37
-        $result = $repo->withCount(['administrators'])->get()->filter(function ($role) {
37
+        $result = $repo->withCount(['administrators'])->get()->filter(function($role) {
38 38
             return $role->administrators_count > 0;
39 39
         })->pluck('administrators_count', 'name');
40 40
 
Please login to merge, or discard this patch.
src/FoundationServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,11 +105,11 @@
 block discarded – undo
105 105
      */
106 106
     protected function registerModuleManifest(): void
107 107
     {
108
-        $this->singleton(PackageManifest::class, function (Application $app) {
108
+        $this->singleton(PackageManifest::class, function(Application $app) {
109 109
             return new PackageManifest(new Filesystem, $app->basePath());
110 110
         });
111 111
 
112
-        $this->singleton(ModuleManifest::class, function (Application $app) {
112
+        $this->singleton(ModuleManifest::class, function(Application $app) {
113 113
             return new ModuleManifest(
114 114
                 new Filesystem, $app->basePath(), $app->bootstrapPath(Arcanesoft::ARCANESOFT_MODULES_CACHE)
115 115
             );
Please login to merge, or discard this patch.
src/Helpers/Sidebar/Item.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -288,7 +288,7 @@
 block discarded – undo
288 288
      */
289 289
     protected function checkCanSeeChildren($administrator): bool
290 290
     {
291
-        return $this->children->filter(function (Item $child) use ($administrator) {
291
+        return $this->children->filter(function(Item $child) use ($administrator) {
292 292
             return $child->canSee($administrator);
293 293
         })->isNotEmpty();
294 294
     }
Please login to merge, or discard this patch.