interface EventDispatchingNodeCommandControllerPluginInterface implements NodeCommandControllerPluginInterface (View source)

An interface for plugins for the NodeCommandController that dispatches events

Constants

EVENT_TASK

Entering a task. Event arguments are $taskDescription, $taskClosure (only executed if not in dry-run) and (optionally) a $requiresConfirmation flag

EVENT_NOTICE

A notice is printed to the console

EVENT_WARNING

A warning is printed to the console but does not quit the execution

EVENT_ERROR

An error is printed to the console and stops the execution with an error exit code

Methods

static string
getSubCommandShortDescription(string $controllerCommandName)

Returns a short description for the specific task the plugin solves for the specified command

static string
getSubCommandDescription(string $controllerCommandName)

Returns a piece of description for the specific task the plugin solves for the specified command

void
invokeSubCommand(string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', bool $dryRun = false, bool $cleanup = true)

A method which runs the task implemented by the plugin for the given command

void
on(string $eventIdentifier, Closure $callback)

Attaches a new event handler

Details

static string getSubCommandShortDescription(string $controllerCommandName)

Returns a short description for the specific task the plugin solves for the specified command

Parameters

string $controllerCommandName

Name of the command in question, for example "repair"

Return Value

string

A brief description / summary for the task this plugin is going to do

static string getSubCommandDescription(string $controllerCommandName)

Returns a piece of description for the specific task the plugin solves for the specified command

Parameters

string $controllerCommandName

Name of the command in question, for example "repair"

Return Value

string

A piece of text to be included in the overall description of the node:xy command

void invokeSubCommand(string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', bool $dryRun = false, bool $cleanup = true)

A method which runs the task implemented by the plugin for the given command

Parameters

string $controllerCommandName

Name of the command in question, for example "repair"

ConsoleOutput $output

An instance of ConsoleOutput which can be used for output or dialogues

NodeType $nodeType

Only handle this node type (if specified)

string $workspaceName

Only handle this workspace (if specified)

bool $dryRun

If true, don't do any changes, just simulate what you would do

bool $cleanup

If false, cleanup tasks are skipped

Return Value

void

void on(string $eventIdentifier, Closure $callback)

Attaches a new event handler

Parameters

string $eventIdentifier

one of the EVENT_* constants

Closure $callback

a closure to be invoked when the corresponding event was triggered

Return Value

void