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