/** * @param LeagueUriInterface|UriInterface $relative * * @return LeagueUriInterface|UriInterface */ protected function generate($relative) { $scheme = $relative->getScheme(); if (!empty($scheme) && $scheme != $this->uri->getScheme()) { return $relative; } if (!empty($relative->getAuthority())) { return $relative->withScheme($this->uri->getScheme()); } return $this->resolveRelative($relative)->withFragment($relative->getFragment()); }
/** * {@inheritdoc} */ public function relativize(Interfaces\Uri $relative) { if (!$this->scheme->sameValueAs($relative->scheme) || $this->getAuthority() !== $relative->getAuthority()) { return $relative; } return $relative->withScheme('')->withUserInfo('')->withHost('')->withPort('')->withPath($this->path->relativize($relative->path)->__toString()); }