PHP Class luya\console\Controller

Extends the base controller by adding helper methods to output responses based on its muted behavior to run unit tests without respones.
Author: Basil Suter ([email protected])
Inheritance: extends yii\console\Controller
Datei anzeigen Open project: luyadev/luya

Public Methods

Method Description
isMuted ( ) : boolean Helper method to see if the current Application is muted or not. If the Application is muted, no output will displayed.
outputError ( string $message ) : number Helper method to stop the console command with an error message, outputError returns exit code 1.
outputInfo ( string $message ) : number Helper method to stop the console command with a info message which is threated in case of returns as success but does have a different output color (blue). outputInfo returns exit code 0.
outputSuccess ( string $message ) : number Helper method to stop the console command with a success message, outputSuccess returns exit code 0.

Protected Methods

Method Description
output ( string $message, string $color = null ) Helper method for writting console application output, include before and after wrappers.

Method Details

isMuted() public method

Helper method to see if the current Application is muted or not. If the Application is muted, no output will displayed.
public isMuted ( ) : boolean
return boolean

output() protected method

Helper method for writting console application output, include before and after wrappers.
protected output ( string $message, string $color = null )
$message string The message which is displayed
$color string A color from {{\yii\helpers\Console}} color constants.

outputError() public method

Helper method to stop the console command with an error message, outputError returns exit code 1.
public outputError ( string $message ) : number
$message string The message which should be displayed.
return number Exit code 1

outputInfo() public method

Helper method to stop the console command with a info message which is threated in case of returns as success but does have a different output color (blue). outputInfo returns exit code 0.
Since: 1.0.0-beta5
public outputInfo ( string $message ) : number
$message string The message which sould be displayed.
return number Exit code 0

outputSuccess() public method

Helper method to stop the console command with a success message, outputSuccess returns exit code 0.
public outputSuccess ( string $message ) : number
$message string The message which sould be displayed
return number Exit code 0