| 1 | <?php |
||
| 12 | final class ProductCode |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $code; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param string $code |
||
| 21 | */ |
||
| 22 | private function __construct(string $code) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $code |
||
| 33 | * |
||
| 34 | * @return self |
||
| 35 | */ |
||
| 36 | public static function fromString($code): self |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | public function __toString(): string |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param ProductCode $productCode |
||
| 51 | * |
||
| 52 | * @return bool |
||
| 53 | */ |
||
| 54 | public function equals(ProductCode $productCode): bool |
||
| 58 | } |
||
| 59 |