line(json_encode($this->options())); # $this->ask('What?'); # throw new Quit('Nope', 5); $files = $this->getFiles(); if ($this->confirm('Do you wish to continue?', true)) { $this->line(json_encode($files)); } return static::SUCCESS; } protected function getFiles(): array { $input = $this->option('input'); if (empty($input)) { throw new Quit('No files given'); } $files = array_map(function (string $file) { if (!file_exists($file)) { throw new Quit("$file is not a valid file"); } return realpath($file); }, $input); return $files; } }