private function addNamedRoute($name, $httpMethod, $route, $handler)
    {
        if (! ($this->dataGenerator instanceof NamedDataGeneratorInterface)) {
            throw new \RuntimeException('The injected generator does not support named routes');
        }

        $routeData = $this->routeParser->parse($route);

        foreach ($routeData as $routeDatum) {
            $this->dataGenerator->addNamedRoute($name, $httpMethod, $routeDatum, $handler);
        }
    }