Total Complexity | 5 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class AuthorizationSeeder extends Seeder |
||
13 | { |
||
14 | public $priority = 0; |
||
15 | |||
16 | /** |
||
17 | * @var AuthorizationService |
||
18 | */ |
||
19 | protected $service; |
||
20 | |||
21 | /** |
||
22 | * AuthorizationSeeder constructor. |
||
23 | * |
||
24 | * @param $service |
||
25 | */ |
||
26 | public function __construct(AuthorizationContract $service) |
||
27 | { |
||
28 | $this->service = $service; |
||
|
|||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Run the database seeds. |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | public function run() |
||
41 | } |
||
42 | |||
43 | |||
44 | private function createPermissions(): void |
||
45 | { |
||
46 | $permissions = get_class_constants(PermissionAttributes::class); |
||
47 | $this->service->createPermissions(collect($permissions)->flatten()->toArray()); |
||
48 | } |
||
49 | |||
50 | private function createRoles(): void |
||
60 | } |
||
61 | } |
||
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.