name = $name; if (\mb_strlen($value) > self::MAX_VALUE_LENGTH) { $this->longValue = $value; $this->value = \mb_substr($value, 0, 250); } else { $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->longValue ?? $this->value; } /** * @return string */ public function getUrlValue(): string { return $this->urlValue; } /** * @return string */ public function __toString(): string { return $this->getName() . ': ' . $this->getValue(); } }