protected function addMultisiteRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method)
    {
        $paths = $this->siteContext->normalizePaths($annot->getPaths());

        foreach ($paths as $branding => $locales) {
            foreach ($locales as $locale => $path) {

                // this block of code is copied from Symfony\Component\Routing\Loader\AnnotationFileLoader
                $name = $annot->getName();
                if (null === $name) {
                    $name = $this->getDefaultRouteName($class, $method);
                }
                $name = MultisiteRouter::ROUTE_PREFIX.'_'.$branding.'_'.$locale.'__'.$name;

                $defaults = array_replace($globals['defaults'], $annot->getDefaults());
                foreach ($method->getParameters() as $param) {
                    if (!isset($defaults[$param->getName()]) && $param->isOptional()) {
                        $defaults[$param->getName()] = $param->getDefaultValue();
                    }
                }

                // +2 lines
                $defaults['_branding'] = $branding;
                $defaults['_locale']   = $locale;

                $requirements = array_replace($globals['requirements'], $annot->getRequirements());
                $options = array_replace($globals['options'], $annot->getOptions());
                $schemes = array_replace($globals['schemes'], $annot->getSchemes());
                $methods = array_replace($globals['methods'], $annot->getMethods());

                $host = $annot->getHost();
                if (null === $host) {
                    $host = $globals['host'];
                }

                // +3 lines
                if (!$host) {
                    $host = $this->siteContext->getBranding($branding)->getHost($locale);
                }

                $condition = $annot->getCondition();
                if (null === $condition) {
                    $condition = $globals['condition'];
                }

                $route = new Route($globals['path'].$path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
                $this->configureRoute($route, $class, $method, $annot);

                $collection->add($name, $route);
            }
        }

        // cache will refresh when file is modified
        $collection->addResource(new FileResource($class->getFileName()));

        return $collection;
    }