Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 3 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
21 | 4 | public function handle() |
|
22 | { |
||
23 | 4 | $roleClass = \app(\config('permission.models.role')); |
|
24 | |||
25 | 4 | $name = $this->argument('name'); |
|
26 | 4 | $guard = $this->argument('guard'); |
|
27 | 4 | $permissions = $this->option('permission'); |
|
28 | |||
29 | 4 | $role = $roleClass::create([ |
|
|
|||
30 | 4 | 'name' => $name, |
|
31 | 4 | 'guard_name' => $guard |
|
32 | ]); |
||
33 | |||
34 | 4 | $this->info("Role `{$role->name}` created"); |
|
35 | |||
36 | 4 | $role->givePermissionTo($permissions); |
|
37 | 4 | $permissionsStr = $role->permissions->implode('name', '`, `'); |
|
38 | 4 | $this->info("Permissions `{$permissionsStr}` has been given to role `{$role->name}`"); |
|
39 | 4 | } |
|
41 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.