/** * Returns the current resolver * It also create a new resolver if it's not exists. * * @return RequestResolvers\RequestResolverInterface */ public function getResolver() { if ($this->resolver === null) { $this->resolver = new $this->resolverClass(UrlRedirect::resolve($this->buildUrl()), $this->resolverConfig); $this->parseUrl($this->resolver->getUrl()); } return $this->resolver; }
/** * Magic method to retrieve the resolver an url in lazy mode */ public function __get($name) { switch ($name) { case 'url': return $this->url = new Url($this->resolver->getUrl()); case 'resolver': $this->resolver = new $this->resolverClass(UrlRedirect::resolve($this->startingUrl->getUrl())); if (is_array($this->resolverConfig)) { $this->resolver->setConfig($this->resolverConfig); } return $this->resolver; } }