Webmozart\Console\Api\IO\Output::setFormatter PHP Method

setFormatter() public method

Sets the output formatter.
public setFormatter ( Webmozart\Console\Api\Formatter\Formatter $formatter )
$formatter Webmozart\Console\Api\Formatter\Formatter The output formatter.
    public function setFormatter(Formatter $formatter)
    {
        $this->formatter = $formatter;
        $this->formatOutput = $this->stream->supportsAnsi() || !$formatter instanceof AnsiFormatter;
    }

Usage Example

コード例 #1
0
ファイル: OutputTest.php プロジェクト: webmozart/console
 public function testWriteLineRawDoesNotFormatText()
 {
     $formatter = $this->getMock('Webmozart\\Console\\Api\\Formatter\\Formatter');
     $formatter->expects($this->never())->method('format');
     $this->output->setFormatter($formatter);
     $this->output->writeLineRaw('<tag>text</tag>');
     $this->assertSame('<tag>text</tag>' . PHP_EOL, $this->stream->fetch());
 }
All Usage Examples Of Webmozart\Console\Api\IO\Output::setFormatter