protected function processOptions(InputInterface $input, OutputInterface $output): void
    {
        $exclude = TypeCast::castString($input->getOption('exclude'));
        $format = $input->getOption('format');
        $this->format = is_string($format) ? $format : null;
        $basePath = $input->getOption('directory');
        $this->basePath = is_string($basePath) ? $basePath : './';

        // Add slash to the path
        if (substr($this->basePath, -1) !== '/') {
            $this->basePath .= '/';
        }

        $this->verbose = $output->isVerbose();
        $this->output = $output;
        $this->skipClasses = (bool)$input->getOption('skip-classes');
        $this->skipMethods = (bool)$input->getOption('skip-methods');
        $this->skipSignatures = (bool)$input->getOption('skip-signatures');

        // Set up excludes:
        if (!empty($exclude)) {
            $this->exclude = array_map('trim', explode(',', $exclude));
        }
    }