installation-bundle/src/Controller/InstallationController.php
private function addDefaultsToContext(array $context): array
    {
        $context = array_merge($this->context, $context);

        if (!isset($context['request_token'])) {
            $context['request_token'] = $this->getRequestToken();
        }

        if (!isset($context['language'])) {
            $context['language'] = $this->container->get('translator')->getLocale();
        }

        if (!isset($context['ua'])) {
            $context['ua'] = $this->getUserAgentString();
        }

        if (!isset($context['path'])) {
            $request = $this->container->get('request_stack')->getCurrentRequest();

            if (null === $request) {
                throw new \RuntimeException('The request stack did not contain a request');
            }

            $context['host'] = $request->getHost();
            $context['path'] = $request->getBasePath();
        }

        return $context;
    }
private function addDefaultsToContext(array $context): array
    {
        $context = array_merge($this->context, $context);

        if (!isset($context['request_token'])) {
            $context['request_token'] = $this->getRequestToken();
        }

        if (!isset($context['language'])) {
            $context['language'] = $this->container->get('translator')->getLocale();
        }

        if (!isset($context['ua'])) {
            $context['ua'] = $this->getUserAgentString();
        }

        if (!isset($context['path'])) {
            $request = $this->container->get('request_stack')->getCurrentRequest();

            if (null === $request) {
                throw new \RuntimeException('The request stack did not contain a request');
            }

            $context['host'] = $request->getHost();
            $context['path'] = $request->getBasePath();
        }

        return $context;
    }
Adds the default values to the context.

@throws \RuntimeException

@return array<string,string>