\Charcoal\App\ScriptScriptInterface

Script are actions called from the CLI.

Typically, with the charcoal bin.

Summary

Methods
Constants
setDependencies()
setIdent()
ident()
setDescription()
description()
setArguments()
addArgument()
arguments()
argument()
run()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

setDependencies()

setDependencies(\Pimple\Container  $container) : void

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

\Pimple\Container $container

A dependencies container instance.

setIdent()

setIdent(string  $ident) : \Charcoal\App\Script\ScriptInterface

Parameters

string $ident

The script identifier string.

Returns

\Charcoal\App\Script\ScriptInterface

Chainable

ident()

ident() : string

Returns

string

setDescription()

setDescription(string  $description) : \Charcoal\App\Script\ScriptInterface

Parameters

string $description

The script description.

Returns

\Charcoal\App\Script\ScriptInterface

Chainable

description()

description() : string

Returns

string

setArguments()

setArguments(array  $arguments) : \Charcoal\App\Script\ScriptInterface

Parameters

array $arguments

The script arguments array, as [key=>value].

Returns

\Charcoal\App\Script\ScriptInterface

Chainable

addArgument()

addArgument(string  $argumentIdent, array  $argument) : \Charcoal\App\Script\ScriptInterface

Parameters

string $argumentIdent

The argument identifier.

array $argument

The argument options.

Returns

\Charcoal\App\Script\ScriptInterface

Chainable

arguments()

arguments() : array

Returns

array —

$arguments

argument()

argument(string  $argumentIdent) : array

Parameters

string $argumentIdent

The argument identifier to retrieve options from.

Returns

array

run()

run(\Psr\Http\Message\RequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) : \Psr\Http\Message\ResponseInterface

Run the script.

Parameters

\Psr\Http\Message\RequestInterface $request

A PSR-7 compatible Request instance.

\Psr\Http\Message\ResponseInterface $response

A PSR-7 compatible Response instance.

Returns

\Psr\Http\Message\ResponseInterface