protected function getArgumentsWithDriver(...$arguments): array
    {
        \array_unshift($arguments, 'driver');

        $resolvedArguments = [];

        $this->validateMissingArguments($arguments);

        if (empty($this->argument(\end($arguments)))) {
            $driver = $this->getDriverFromConfig();

            if (empty($driver)) {
                throw new RuntimeException('Not enough arguments (missing: "driver").');
            }

            $resolvedArguments['driver'] = $driver;

            for ($i = 1; $i < \count($arguments); $i++) {
                $resolvedArguments[$arguments[$i]] = $this->argument($arguments[$i - 1]);
            }
        } else {
            foreach ($arguments as $argument) {
                $resolvedArguments[$argument] = $this->argument($argument);
            }
        }

        return $resolvedArguments;
    }