key = $key; $this->value = $value; } public function __toString(): string { if ($this->key !== null) { return sprintf('%s => %s', $this->key, $this->value); } return (string) $this->value; } }