| 1 | <?php |
||
| 7 | final class Text implements ValueObjectInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | private const NIL = ""; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $value; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param string|null $nativeValue |
||
| 21 | * @return self |
||
| 22 | */ |
||
| 23 | 52 | public static function fromNative($nativeValue): self |
|
| 28 | |||
| 29 | 5 | public function equals(ValueObjectInterface $otherValue): bool |
|
| 33 | |||
| 34 | 29 | public function toNative(): string |
|
| 38 | |||
| 39 | 7 | public function __toString(): string |
|
| 43 | |||
| 44 | 8 | public function isEmpty(): bool |
|
| 48 | |||
| 49 | 1 | public function getLength(): int |
|
| 53 | |||
| 54 | 52 | private function __construct(string $value = self::NIL) |
|
| 58 | } |
||
| 59 |