Fr3nch13/CakePHP Utilities

CommandInterface

Describe the interface between a command and the surrounding console libraries.

Table of Contents

Constants

CODE_ERROR  = 1
Default error code
CODE_SUCCESS  = 0
Default success code

Methods

run()  : int|null
Run the command.
setName()  : $this
Set the name this command uses in the collection.

Constants

Methods

run()

Run the command.

public run(array<string|int, mixed> $argv, ConsoleIo $io) : int|null
Parameters
$argv : array<string|int, mixed>

Arguments from the CLI environment.

$io : ConsoleIo

The console io

Return values
int|null

Exit code or null for success.

setName()

Set the name this command uses in the collection.

public setName(string $name) : $this

Generally invoked by the CommandCollection when the command is added. Required to have at least one space in the name so that the root command can be calculated.

Parameters
$name : string

The name the command uses in the collection.

Tags
throws
InvalidArgumentException
Return values
$this

        
On this page

Search results