yii\helpers\BaseConsole::error PHP Method

error() public static method

Prints text to STDERR appended with a carriage return (PHP_EOL).
public static error ( string $string = null ) : integer | boolean
$string string the text to print
return integer | boolean number of bytes printed or false on error.
    public static function error($string = null)
    {
        return static::stderr($string . PHP_EOL);
    }

Usage Example

コード例 #1
0
ファイル: Console.php プロジェクト: darkair/yii2-console
 /**
  * Prints text to STDERR appended with a carriage return (PHP_EOL).
  * @param  string          $string the text to print
  * @return integer|boolean number of bytes printed or false on error.
  */
 public static function error($string = null, $useEol = true)
 {
     return parent::error(self::renderColoredString("%r{$string}%n"), $useEol);
 }