Interface ScriptInterface
Script are actions called from the CLI.
Typically, with the charcoal
bin.
Methods summary
public
|
#
setDependencies( Pimple\Container $container )
Give an opportunity to children classes to inject dependencies from a Pimple Container.
Give an opportunity to children classes to inject dependencies from a Pimple Container.
Does nothing by default, reimplement in children classes.
The $container DI-container (from Pimple ) should not be saved or passed around, only to be used to
inject dependencies (typically via setters).
Parameters
- $container
- A dependencies container instance.
|
public
Charcoal\App\Script\ScriptInterface
|
#
setIdent( string $ident )
Parameters
- $ident
- The script identifier string.
Returns
|
public
string
|
|
public
Charcoal\App\Script\ScriptInterface
|
#
setDescription( string $description )
Parameters
- $description
- The script description.
Returns
|
public
string
|
|
public
Charcoal\App\Script\ScriptInterface
|
#
setArguments( array $arguments )
Parameters
- $arguments
- The script arguments array, as [key=>value].
Returns
|
public
Charcoal\App\Script\ScriptInterface
|
#
addArgument( string $argumentIdent, array $argument )
Parameters
- $argumentIdent
- The argument identifier.
- $argument
- The argument options.
Returns
|
public
array
|
|
public
array
|
#
argument( string $argumentIdent )
Parameters
- $argumentIdent
- The argument identifier to retrieve options from.
Returns
array
|
public
Psr\Http\Message\ResponseInterface
|
#
run( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )
Run the script.
Parameters
- $request
- A PSR-7 compatible Request instance.
- $response
- A PSR-7 compatible Response instance.
Returns
Psr\Http\Message\ResponseInterface
|