Lines
100.00%
3 / 3
Methods
100.00%
3 / 3
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| getRoles | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| setRole | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| 18 | class UserAdminCommand extends UserAdminBaseCommand | |
| 19 | { | |
| 20 | public function __construct( | |
| 21 | EntityManagerInterface $entityManager, | |
| 22 | UserRepository $userRepository, | |
| 23 | ) { | |
| 24 | parent::__construct($entityManager, $userRepository); | |
| 25 | } | |
| 26 | ||
| 27 | /** | |
| 28 | * @return array<\BackedEnum> | |
| 29 | */ | |
| 30 | protected function getRoles(): array | |
| 31 | { | |
| 32 | return UserRole::cases(); | |
| 33 | } | |
| 34 | ||
| 35 | /** | |
| 36 | * @param User $user | |
| 37 | */ | |
| 38 | protected function setRole(UserInterface $user, string $role): User | |
| 39 | { | |
| 40 | return $user->setRole(UserRole::from($role)); | |
| 41 | } | |
| 42 | } |