| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | private function createRoles(): void |
||
| 51 | { |
||
| 52 | $roles = get_class_constants(RolePermissions::class); |
||
| 53 | foreach ($roles as $role => $permissions) { |
||
| 54 | $this->service->createRole(strtolower($role), $permissions); |
||
| 55 | } |
||
| 56 | |||
| 57 | /* Create the admin role with all possible permissions */ |
||
| 58 | $permissions = get_class_constants(PermissionAttributes::class); |
||
| 59 | $this->service->createRole(Role::ADMIN, collect($permissions)->flatten()->toArray()); |
||
| 60 | } |
||
| 62 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.