Webmozart\Console\IO\ConsoleIO::__construct PHP Method

__construct() public method

Creates the I/O.
public __construct ( Input $input = null, Output $output = null, Output $errorOutput = null )
$input Webmozart\Console\Api\IO\Input The standard input.
$output Webmozart\Console\Api\IO\Output The standard output.
$errorOutput Webmozart\Console\Api\IO\Output The error output.
    public function __construct(Input $input = null, Output $output = null, Output $errorOutput = null)
    {
        if (null === $input) {
            $inputStream = new StandardInputStream();
            $input = new Input($inputStream);
        }
        if (null === $output) {
            $outputStream = new StandardOutputStream();
            $formatter = $outputStream->supportsAnsi() ? new AnsiFormatter() : new PlainFormatter();
            $output = new Output($outputStream, $formatter);
        }
        if (null === $errorOutput) {
            $errorStream = new ErrorOutputStream();
            $formatter = $errorStream->supportsAnsi() ? new AnsiFormatter() : new PlainFormatter();
            $errorOutput = new Output($errorStream, $formatter);
        }
        parent::__construct($input, $output, $errorOutput);
    }