pho\Console\Console::__construct PHP Method

__construct() public method

The constructor stores the arguments to be parsed, and creates instances of both ConsoleFormatter and ConsoleOptionParser. Also, if either a test or spec directory exists, they are set as the default paths to traverse.
public __construct ( array $arguments, string $stream )
$arguments array An array of argument strings
$stream string The I/O stream to use when writing
    public function __construct($arguments, $stream)
    {
        $this->arguments = $arguments;
        $this->options = [];
        $this->paths = [];
        $this->stream = fopen($stream, 'w');
        $this->formatter = new ConsoleFormatter();
        $this->optionParser = new ConsoleOptionParser();
        // The default folders to look in are ./test and ./spec
        foreach ($this->defaultDirs as $dir) {
            if (file_exists($dir) && is_dir($dir)) {
                $this->paths[] = $dir;
            }
        }
    }