public function getUrlGenerator()
{
if (!$this->urlGenerator) {
$this->urlGenerator = call_user_func($this->factory);
if (!$this->urlGenerator instanceof UrlGeneratorInterface) {
throw new \LogicException('Factory supplied to LazyUrlGenerator must return implementation of UrlGeneratorInterface.');
}
}
return $this->urlGenerator;
}