| __construct(Command $parent = null) | |
string | __toString() Returns command as string. | |
static Command | create(Command $parent = null) Creates a new Command instance. | |
static string | escape(string $input) Escapes special chars from input. | |
static string | quote(string $input) Quotes input. | |
$this | add(string|Command $bit) Appends a string or a Command instance. | |
$this | top(string|Command $bit) Prepends a string or a command instance. | |
$this | arg(string $arg) Appends an argument, will be quoted. | |
$this | cmd(string $esc) Appends escaped special command chars. | |
Command|string | ins(string $label) Inserts a labeled command to feed later. | |
Command|string | get(string $label) Retrieves a previously labeled command. | |
Command | end() Returns parent command (if any). | |
int | length() Counts bits stored in command. | |
$this | setErrorHandler(Closure $errorHandler) | |
Closure|null | getErrorHandler() | |
array | execute() Executes current command. | |
string | join() Joins bits. | |
$this | addAtIndex(string|Command $bit, int $index) Insert a string or a Command instance before the bit at given position $index (index starts from 0). | |
__construct(Command $parent = null)
Parameters
string
__toString()
Returns command as string.
Return Value
static Command
create(Command $parent = null)
Creates a new Command instance.
Parameters
Return Value
static string
escape(string $input)
Escapes special chars from input.
Parameters
string | $input | A string to escape |
Return Value
string | The escaped string |
static string
quote(string $input)
Quotes input.
Parameters
string | $input | An argument string |
Return Value
$this
add(string|Command $bit)
Appends a string or a Command instance.
Parameters
Return Value
$this
top(string|Command $bit)
Prepends a string or a command instance.
Parameters
Return Value
$this
arg(string $arg)
Appends an argument, will be quoted.
Parameters
Return Value
$this
cmd(string $esc)
Appends escaped special command chars.
Parameters
Return Value
Command|string
ins(string $label)
Inserts a labeled command to feed later.
Parameters
string | $label | The unique label |
Return Value
Exceptions
Command|string
get(string $label)
Retrieves a previously labeled command.
Parameters
Return Value
Exceptions
Returns parent command (if any).
Return Value
Exceptions
int
length()
Counts bits stored in command.
Return Value
$this
setErrorHandler(Closure $errorHandler)
Parameters
Return Value
Closure|null
getErrorHandler()
Return Value
array
execute()
Executes current command.
Return Value
Exceptions
string
join()
Joins bits.
Return Value
$this
addAtIndex(string|Command $bit, int $index)
Insert a string or a Command instance before the bit at given position $index (index starts from 0).
Parameters
Return Value