AhgTask
extends sfBaseTask
in package
AbstractYes
Base task class for AHG CLI commands.
Extends sfBaseTask with framework bootstrap and modern helpers. Plugin task classes should extend this instead of sfBaseTask directly.
Usage: class myCustomTask extends AhgTask { protected function configure() { $this->addArguments([...]); $this->namespace = 'my'; $this->name = 'custom'; }
protected function execute($arguments = [], $options = []) {
$this->initFramework();
// Framework is now bootstrapped
}
}
Table of Contents
Methods
- __construct() : mixed
- execute() : mixed
- Override in task subclasses.
- getArguments() : array<string|int, mixed>
- getBriefDescription() : string
- getDetailedDescription() : string
- getFullName() : string
- getName() : string
- getNamespace() : string
- getOptions() : array<string|int, mixed>
- run() : int
- Run the task with parsed arguments and options.
Methods
__construct()
public
__construct([mixed $dispatcher = null ][, mixed $formatter = null ]) : mixed
Parameters
- $dispatcher : mixed = null
- $formatter : mixed = null
execute()
Override in task subclasses.
public
abstract execute([mixed $arguments = [] ][, mixed $options = [] ]) : mixed
Parameters
- $arguments : mixed = []
- $options : mixed = []
getArguments()
public
getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>getBriefDescription()
public
getBriefDescription() : string
Return values
stringgetDetailedDescription()
public
getDetailedDescription() : string
Return values
stringgetFullName()
public
getFullName() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetNamespace()
public
getNamespace() : string
Return values
stringgetOptions()
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>run()
Run the task with parsed arguments and options.
public
run([array<string|int, mixed> $arguments = [] ][, array<string|int, mixed> $options = [] ]) : int
Called by TaskRunner after argument parsing.
Parameters
- $arguments : array<string|int, mixed> = []
- $options : array<string|int, mixed> = []