SeedDevAccountsCommand
extends Command
in package
Seeds test accounts used by the dev quick-login panel.
Idempotent (upsert by email), purges nothing, sends no email. Refuses to run unless DEV_QUICK_LOGIN is enabled.
Attributes
- #[AsCommand]
- $name: 'app:seed-dev-accounts'
- $description: 'Create or update the @dev.local test accounts (requires DEV_QUICK_LOGIN=true)'
Table of Contents
Constants
- COMPANY_NAME : mixed = 'Dev Corp'
- PASSWORD : mixed = 'password'
Properties
- $devQuickLogin : bool
- $entityManager : EntityManagerInterface
- $passwordHasher : UserPasswordHasherInterface
- $planRepository : PlanRepository
Methods
- __construct() : mixed
- execute() : int
- ensureEmployee() : void
- ensureSubscription() : void
- getOrCreateCompany() : Company
Constants
COMPANY_NAME
private
mixed
COMPANY_NAME
= 'Dev Corp'
PASSWORD
private
mixed
PASSWORD
= 'password'
Properties
$devQuickLogin read-only
private
bool
$devQuickLogin
$entityManager read-only
private
EntityManagerInterface
$entityManager
$passwordHasher read-only
private
UserPasswordHasherInterface
$passwordHasher
$planRepository read-only
private
PlanRepository
$planRepository
Methods
__construct()
public
__construct(bool $devQuickLogin, EntityManagerInterface $entityManager, UserPasswordHasherInterface $passwordHasher, PlanRepository $planRepository) : mixed
Parameters
- $devQuickLogin : bool
- $entityManager : EntityManagerInterface
- $passwordHasher : UserPasswordHasherInterface
- $planRepository : PlanRepository
execute()
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
intensureEmployee()
private
ensureEmployee(string $email, string $name, Company $company) : void
Parameters
- $email : string
- $name : string
- $company : Company
ensureSubscription()
private
ensureSubscription(User $user, string $planName, bool $isNewUser, SymfonyStyle $io) : void
Parameters
- $user : User
- $planName : string
- $isNewUser : bool
- $io : SymfonyStyle
getOrCreateCompany()
private
getOrCreateCompany() : Company