| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | abstract class AbstractCommand extends Command implements ServiceSubscriberInterface |
||
| 16 | { |
||
| 17 | use ServiceSubscriberTrait; |
||
| 18 | |||
| 19 | protected function findUserByEmail(string $email): ?User |
||
| 20 | { |
||
| 21 | return $this->getEntityManager()->getRepository(User::class)->findOneBy(['email' => $email]); |
||
| 22 | } |
||
| 23 | |||
| 24 | protected function findRoleByName(string $name): ?Role |
||
| 25 | { |
||
| 26 | return $this->getEntityManager()->getRepository(Role::class)->findOneBy(['name' => $name]); |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return Role[] |
||
| 31 | */ |
||
| 32 | protected function findAllRoles() |
||
| 33 | { |
||
| 34 | return $this->getEntityManager()->getRepository(Role::class)->findAll(); |
||
| 35 | } |
||
| 36 | |||
| 37 | protected function getEntityManager(): EntityManagerInterface |
||
| 40 | } |
||
| 41 | |||
| 42 | protected function getParameterBag(): ParameterBagInterface |
||
| 45 | } |
||
| 46 | |||
| 47 | protected function isTestEnv(): bool |
||
| 48 | { |
||
| 52 |