name = $name; $this->value = $value; if (!$urlValue) { $urlValue = $value; } $this->urlValue = $urlValue; } public function initializeObject(): void { if ($this->urlValue === $this->value) { $this->urlValue = \str_replace( \array_column($this->replacementMap, 'key'), \array_column($this->replacementMap, 'value'), $this->urlValue ); $this->urlValue = \urlencode(\strtolower($this->urlValue)); } } /** * @return string */ public function getName(): string { return $this->name; } /** * @return string */ public function getValue(): string { return $this->value; } /** * @return string */ public function getUrlValue(): string { return $this->urlValue; } /** * @return string */ public function __toString(): string { return $this->getName() . ': ' . $this->getValue(); } }