PHP Class Clinner\Command\NullCommand

This class represents a null command (Null Object pattern implementation).
Author: José Nahuel Cuesta Luengo ([email protected])
Inheritance: implements Clinner\Command\CommandInterface, implements Clinner\Command\PipingCommandInterface, implements PipeableCommandInterface
Show file Open project: ncuesta/clinner

Public Methods

Method Description
getErrorOutput ( ) : string Get the output for this command's execution.
getExitCode ( ) : integer Get the exit code for this command's execution.
getOutput ( ) : string Get the output for this command's execution.
getPipedCommand ( ) : Clinner\Command\PipeableCommandInterface Get the command piped to this one, if any.
hasPipedCommand ( ) : boolean Answer whether this command has a command piped to it.
pipe ( PipeableCommandInterface $anotherCommand, boolean $appendToPipe = true ) : Clinner\Command\PipingCommandInterface Pipe $anotherCommand to this one, so that this command's output is directly sent to $anotherCommand's standard input.
run ( string $input = null ) : Clinner\Command\CommandInterface Run this command and get the exit code for it.
toCommandString ( ) : string Get a string representing this command.

Method Details

getErrorOutput() public method

This method will only return a valid value after the command has been executed.
public getErrorOutput ( ) : string
return string

getExitCode() public method

This method will only return a valid value after the command has been executed.
public getExitCode ( ) : integer
return integer

getOutput() public method

This method will only return a valid value after the command has been executed.
public getOutput ( ) : string
return string

getPipedCommand() public method

Get the command piped to this one, if any.
public getPipedCommand ( ) : Clinner\Command\PipeableCommandInterface
return Clinner\Command\PipeableCommandInterface

hasPipedCommand() public method

Answer whether this command has a command piped to it.
public hasPipedCommand ( ) : boolean
return boolean

pipe() public method

Pipe $anotherCommand to this one, so that this command's output is directly sent to $anotherCommand's standard input.
public pipe ( PipeableCommandInterface $anotherCommand, boolean $appendToPipe = true ) : Clinner\Command\PipingCommandInterface
$anotherCommand PipeableCommandInterface The command to pipe.
$appendToPipe boolean Whether $anotherCommand will be appended to the currently piped commands (TRUE) or if it will be added after this command, rearranging the commands pipe to include it.
return Clinner\Command\PipingCommandInterface This instance, for a fluent API.

run() public method

Run this command and get the exit code for it.
public run ( string $input = null ) : Clinner\Command\CommandInterface
$input string (Optional) input string for this command.
return Clinner\Command\CommandInterface This command, for a fluent API.

toCommandString() public method

Get a string representing this command.
public toCommandString ( ) : string
return string