protected static function resolve(
        ContainerInterface $container,
        array $params,
        array $map,
        bool $safe = true
    ): array {
        $args = [];
        foreach ($params as $index => $param) {
            $value = static::getParameterValue($container, $param, $index, $map, $safe);

            if ($value instanceof \Closure) {
                $value = $value($container); // unbox a boxed value
            }

            $args[] = $value; // argument resolved!
        }

        return $args;
    }