uri = $uri; $this->site = $site; $this->language = $language; $this->tail = $tail; $this->data = $data; } public function getUri(): UriInterface { return $this->uri; } public function getSite(): SiteInterface { return $this->site; } public function getLanguage(): ?SiteLanguage { return $this->language; } public function getTail(): string { return $this->tail; } public function offsetExists($offset): bool { return in_array($offset, $this->validProperties, true) || isset($this->data[$offset]); } /** * @internal */ public function withLanguage(SiteLanguage $language): self { $clone = clone $this; $clone->language = $language; return $clone; } /** * @param mixed $offset */ public function offsetGet($offset): mixed { switch ($offset) { case 'uri': return $this->uri; case 'site': return $this->site; case 'language': return $this->language; case 'tail': return $this->tail; default: return $this->data[$offset]; } } /** * @param mixed $offset * @param mixed $value */ public function offsetSet($offset, $value): void { switch ($offset) { case 'uri': throw new \InvalidArgumentException('You can never replace the URI in a route result', 1535462423); case 'site': throw new \InvalidArgumentException('You can never replace the Site object in a route result', 1535462454); case 'language': throw new \InvalidArgumentException('You can never replace the Language object in a route result', 1535462452); case 'tail': $this->tail = $value; break; default: $this->data[$offset] = $value; } } /** * @param mixed $offset */ public function offsetUnset($offset): void { switch ($offset) { case 'uri': throw new \InvalidArgumentException('You can never replace the URI in a route result', 1535462429); case 'site': throw new \InvalidArgumentException('You can never replace the Site object in a route result', 1535462458); case 'language': $this->language = null; break; case 'tail': $this->tail = ''; break; default: unset($this->data[$offset]); } } }