Trait lajax\projectscanner\ConsoleOutputTrait

Implemented bylajax\projectscanner\Scanner
Available since version1.0

Prints a string to console.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
isColorEnabled() Returns a value indicating whether ANSI color is enabled. lajax\projectscanner\ConsoleOutputTrait
stderr() Prints a string to STDERR lajax\projectscanner\ConsoleOutputTrait
stdout() Prints a string to STDOUT lajax\projectscanner\ConsoleOutputTrait

Method Details

isColorEnabled() public method

Returns a value indicating whether ANSI color is enabled.

public boolean isColorEnabled ( $stream STDOUT )
$stream resource

The stream to check.

return boolean

Whether to enable ANSI style in output.

stderr() public method

Prints a string to STDERR

You may optionally format the string with ANSI codes by passing additional parameters using the constants defined in \yii\helpers\Console.

Example:

$this->stderr('This will be red and underlined.', Console::FG_RED, Console::UNDERLINE);
public int|boolean stderr ( $string )
$string string

The string to print

return int|boolean

Number of bytes printed or false on error

stdout() public method

Prints a string to STDOUT

You may optionally format the string with ANSI codes by passing additional parameters using the constants defined in \yii\helpers\Console.

Example:

$this->stdout('This will be red and underlined.', Console::FG_RED, Console::UNDERLINE);
public int|boolean stdout ( $string )
$string string

The string to print

return int|boolean

Number of bytes printed or false on error