/** * Format a UriPart implemented object according to the Formatter properties * * @param UriPart $part * * @return string */ protected function formatUriPart(UriPart $part) { if ($part instanceof QueryInterface) { return $this->queryParser->build($part->toArray(), $this->querySeparator, $this->queryEncoding); } if ($part instanceof HostInterface) { return $this->formatHost($part); } return $part->__toString(); }
/** * @inheritdoc */ public function sameValueAs(UriPart $component) { return $this->getUriComponent() === $component->getUriComponent(); }
/** * Format a League\Uri\Interfaces\UriPart according to the Formatter properties * * @param Interfaces\UriPart $part * * @return string */ protected function formatUriPart(Interfaces\UriPart $part) { if ($part instanceof Interfaces\Query) { return Query::build($part->toArray(), $this->querySeparator, $this->queryEncoding); } if ($part instanceof Interfaces\Host) { return $this->formatHost($part); } return $part->__toString(); }