Subject/SubjectHelper.php
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();
    }
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();
    }
Returns the url for the given type and subject.

@param string                                    $name
@param SubjectRelativeInterface|SubjectInterface $subject
@param bool                                      $path

@return string|null