strip() public static method

Strips ANSI color codes from a string
public static strip ( string $string ) : string
$string string String to strip
return string
コード例 #1
0
ファイル: TestOutputter.php プロジェクト: farazdagi/phrozn
 /**
  * Writes the message $msg to STDERR.
  *
  * @param string $msg The message to output
  * @param string $status Output status
  *
  * @return \Phrozn\Outputter
  */
 public function stderr($msg, $status = self::STATUS_FAIL)
 {
     if (defined('STDERR')) {
         fwrite(STDERR, $msg);
     } else {
         $msg = Color::strip(Color::convert($msg));
         $this->lines[] = trim($msg);
     }
     return $this;
 }
コード例 #2
0
ファイル: Base.php プロジェクト: negativespace/phrozn
 protected function pad($str)
 {
     return str_repeat(' ', strlen(Color::strip(Color::convert($str))));
 }