line(json_encode($this->options())); $dest = $this->getDestination(); $input = $this->getInput(); if ($this->confirm('Do you wish to continue?', true)) { $this->line(json_encode([$input, $dest])); } return static::SUCCESS; } protected function getInput(): Input { $ret = new Input; $input = $this->option('input'); $ret->files = array_map(function (string $file) { if (!file_exists($file)) { throw new Quit("$file is not a valid file"); } return realpath($file); }, $input); // @todo Get additional files $ret->url = $this->option('url'); $this->line(json_encode($ret)); $ret->assertValid(); return $ret; } protected function getDestination(): string { $dir = $this->option('destination'); throw_if(!is_dir($dir), Quit::class, "$dir is not a valid directory"); // @todo find show title return realpath($dir); } }