Phrozn\Runner\CommandLine\Reader::__construct PHP Method

__construct() public method

Setup reader
public __construct ( resource $handle = null, $outputter = null ) : void
$handle resource STDIN if not set, parametrized for flexibility during testing
return void
    public function __construct($handle = null, $outputter = null)
    {
        // initilize input resource
        if (null === $handle) {
            if (defined("STDIN")) {
                $handle = STDIN;
            } else {
                $handle = fopen('php://stdin', 'r');
            }
        }
        if (null === $outputter) {
            $outputter = new Outputter();
        }
        $this->setHandle($handle)->setOutputter($outputter);
    }