Phulp\Output::out PHP Method

out() public static method

This method is used to send some text to STDOUT, maybe with some color
public static out ( string $string ) : void
$string string the text to be sent to STDOUT
return void
    public static function out($string)
    {
        if (!self::$quiet) {
            fwrite(static::$out, $string . PHP_EOL);
        }
    }

Usage Example

Beispiel #1
0
 /**
  * @param Source $src
  * @param mixed $tasks
  *
  * @return Watch
  *
  * @throws \InvalidArgumentException
  */
 public function watch(Source $src, $tasks)
 {
     if (!is_array($tasks) && !is_callable($tasks)) {
         throw new \InvalidArgumentException('Invalid Argument for Phulp::watch');
     }
     if (is_array($tasks)) {
         Output::out('[' . Output::colorize((new \DateTime())->format('H:i:s'), 'light_gray') . '] ' . Output::colorize('the API of Phulp::watch you are using will be deprecated', 'yellow'));
         Output::out('[' . Output::colorize((new \DateTime())->format('H:i:s'), 'light_gray') . '] ' . Output::colorize('Please check the documentation. ', 'yellow'));
     }
     return new Watch($src, $tasks, $this);
 }