| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | public function run() |
||
| 20 | { |
||
| 21 | $user='administrator'; |
||
| 22 | |||
| 23 | Permission::create(['name' => 'edit enrollments']); |
||
| 24 | Permission::create(['name' => 'show enrollments']); |
||
| 25 | Permission::create(['name' => 'remove enrollments']); |
||
| 26 | |||
| 27 | Role::create(['name' => 'administrator']); |
||
| 28 | |||
| 29 | $user->givePermissionTo('edit enrollments'); |
||
|
|
|||
| 30 | $user->assignRole('administrator','admin'); |
||
| 31 | |||
| 32 | } |
||
| 33 | } |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.