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); }