protected function getUrl($name, $subject, $path)
    {
        if ($subject instanceof SubjectRelativeInterface) {
            if (null === $subject = $this->resolve($subject, false)) {
                return null;
            }
        }

        if (!$subject instanceof SubjectInterface) {
            throw new InvalidArgumentException("Expected instance of " . SubjectInterface::class);
        }

        // TODO Cache

        $event = new SubjectUrlEvent($subject, $path);

        $this->eventDispatcher->dispatch($name, $event);

        return $event->getUrl();
    }