Conditions | 4 |
Paths | 4 |
Total Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function handle() |
||
18 | { |
||
19 | $guard = $this->argument('guard'); |
||
20 | |||
21 | if ($guard) { |
||
22 | $guards = Collection::make([$guard]); |
||
23 | } else { |
||
24 | $guards = Permission::pluck('guard_name')->merge(Role::pluck('guard_name'))->unique(); |
||
25 | } |
||
26 | |||
27 | foreach ($guards as $guard) { |
||
28 | $this->info("Guard: $guard"); |
||
29 | |||
30 | $roles = Role::whereGuardName($guard)->orderBy('name')->get()->mapWithKeys(function (Role $role) { |
||
|
|||
31 | return [$role->name => $role->permissions->pluck('name')]; |
||
32 | }); |
||
33 | |||
34 | $permissions = Permission::whereGuardName($guard)->orderBy('name')->pluck('name'); |
||
35 | |||
36 | $body = $permissions->map(function ($permission) use ($roles) { |
||
37 | return $roles->map(function (Collection $role_permissions) use ($permission) { |
||
38 | return $role_permissions->contains($permission) ? ' ✔' : ' ·'; |
||
39 | })->prepend($permission); |
||
40 | }); |
||
41 | |||
42 | $this->table( |
||
43 | $roles->keys()->prepend('')->toArray(), |
||
44 | $body->toArray() |
||
45 | ); |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.