| Total Complexity | 4 | 
| Total Lines | 60 | 
| Duplicated Lines | 0 % | 
| Coverage | 100% | 
| Changes | 1 | ||
| Bugs | 1 | Features | 0 | 
| 1 | <?php | ||
| 8 | trait RolesManager | ||
| 9 | { | ||
| 10 | /** | ||
| 11 | * @param RoleInterface $role | ||
| 12 | * | ||
| 13 | * @throws \Illuminate\Contracts\Container\BindingResolutionException | ||
| 14 | * | ||
| 15 | * @return self | ||
| 16 | */ | ||
| 17 | 1 | public function assignRole(RoleInterface $role): self | |
| 18 |     { | ||
| 19 | 1 | $this->roles = app()->make(RoleModel::class) | |
|  | |||
| 20 | 1 | ->assignRole($this->getRoles(), $role); | |
| 21 | |||
| 22 | 1 | return $this; | |
| 23 | } | ||
| 24 | |||
| 25 | /** | ||
| 26 | * @param array $roles | ||
| 27 | * | ||
| 28 | * @throws \Illuminate\Contracts\Container\BindingResolutionException | ||
| 29 | * | ||
| 30 | * @return self | ||
| 31 | */ | ||
| 32 | 7 | public function assignRoles(array $roles): self | |
| 33 |     { | ||
| 34 | 7 | $this->roles = app()->make(RoleModel::class) | |
| 35 | 7 | ->assignRoles($this->getRoles(), $roles); | |
| 36 | |||
| 37 | 6 | return $this; | |
| 38 | } | ||
| 39 | |||
| 40 | /** | ||
| 41 | * @param RoleInterface $role | ||
| 42 | * | ||
| 43 | * @throws \Illuminate\Contracts\Container\BindingResolutionException | ||
| 44 | * | ||
| 45 | * @return self | ||
| 46 | */ | ||
| 47 | 1 | public function removeRole(RoleInterface $role): self | |
| 53 | } | ||
| 54 | |||
| 55 | /** | ||
| 56 | * @param array $roles | ||
| 57 | * | ||
| 58 | * @throws \Illuminate\Contracts\Container\BindingResolutionException | ||
| 59 | * | ||
| 60 | * @return self | ||
| 61 | */ | ||
| 62 | 2 | public function removeRoles(array $roles): self | |
| 68 | } | ||
| 69 | } | ||
| 70 |