value = new SafeString($value); return $obj; } public static function createEmpty(): self { $obj = new self(); $obj->value = ''; return $obj; } public static function create(string $value): self { $obj = new self(); $obj->value = $value; return $obj; } /** * @return SafeString|string */ public function getValue() { if ($this->value instanceof SafeString) { return $this->value; } return (string) $this->value; } }