private function defaultsViaReflection(StringCommand $command, $callable): array
    {
        if (! \is_callable($callable)) {
            return [];
        }

        $function   = CallableReflection::create($callable);
        $definition = $command->getDefinition();
        $defaults   = [];

        foreach ($function->getParameters() as $parameter) {
            if (! $parameter->isDefaultValueAvailable()) {
                continue;
            }

            $parameterName      = $parameter->name;
            $hyphenatedCaseName = Str::snake($parameterName, '-');

            if ($definition->hasArgument($hyphenatedCaseName) || $definition->hasOption($hyphenatedCaseName)) {
                $parameterName = $hyphenatedCaseName;
            }

            if (! $definition->hasArgument($parameterName) && ! $definition->hasOption($parameterName)) {
                continue;
            }

            $defaults[$parameterName] = $parameter->getDefaultValue();
        }

        return $defaults;
    }