AgeUpMembersCommand
extends Command
in package
CLI command to age up youth members who have turned 18.
Supports dual-path dispatch: when a 'member-age-up' workflow is active, delegates to the workflow engine; otherwise runs legacy age-up logic. Dispatches per kingdom when kingdoms are configured so workflow actions can still use kingdom context without persisted tenant-scoped definitions.
Table of Contents
Properties
- $triggerDispatcher : TriggerDispatcher|null
- Injected dispatcher. Tests may set this manually when constructing the command directly.
Methods
- __construct() : mixed
- buildOptionParser() : ConsoleOptionParser
- execute() : int
- Execute command with dual-path dispatch.
- setTriggerDispatcher() : void
- Set a custom TriggerDispatcher (for testing).
- dispatchViaWorkflow() : bool
- Attempt to dispatch via the workflow engine.
- executeLegacy() : int
- Run the legacy age-up logic.
- getTriggerDispatcher() : TriggerDispatcher
- Resolve the workflow trigger dispatcher.
Properties
$triggerDispatcher
Injected dispatcher. Tests may set this manually when constructing the command directly.
private
TriggerDispatcher|null
$triggerDispatcher
= null
Methods
__construct()
public
__construct([CommandFactoryInterface|null $factory = null ][, TriggerDispatcher|null $triggerDispatcher = null ]) : mixed
Parameters
- $factory : CommandFactoryInterface|null = null
-
Command factory
- $triggerDispatcher : TriggerDispatcher|null = null
-
Workflow trigger dispatcher
buildOptionParser()
public
buildOptionParser(ConsoleOptionParser $parser) : ConsoleOptionParser
Parameters
- $parser : ConsoleOptionParser
Tags
Return values
ConsoleOptionParserexecute()
Execute command with dual-path dispatch.
public
execute(Arguments $args, ConsoleIo $io) : int
Parameters
- $args : Arguments
-
Console arguments instance.
- $io : ConsoleIo
-
Console IO instance.
Return values
intsetTriggerDispatcher()
Set a custom TriggerDispatcher (for testing).
public
setTriggerDispatcher(TriggerDispatcher $dispatcher) : void
Parameters
- $dispatcher : TriggerDispatcher
-
Dispatcher instance
dispatchViaWorkflow()
Attempt to dispatch via the workflow engine.
protected
dispatchViaWorkflow(ConsoleIo $io) : bool
Iterates over all kingdoms when a global workflow definition is active.
Parameters
- $io : ConsoleIo
-
Console IO instance.
Return values
bool —True if workflow was dispatched, false to fall back to legacy.
executeLegacy()
Run the legacy age-up logic.
protected
executeLegacy(Arguments $args, ConsoleIo $io) : int
Parameters
- $args : Arguments
-
Console arguments instance.
- $io : ConsoleIo
-
Console IO instance.
Return values
intgetTriggerDispatcher()
Resolve the workflow trigger dispatcher.
private
getTriggerDispatcher() : TriggerDispatcher