args = new Collection($argv); } public static function make(array $argv): self { return new self($argv); } public function get(int $index) { return $this->args ->reject(fn ($word) => substr($word, 0, 2) === '--') ->get($index); } public function hasOption(string $option) { return $this->args ->filter(fn ($word) => $word === '--' . $option) ->isNotEmpty(); } }