| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | abstract class StringValueObject implements StringValueObjectInterface |
||
| 11 | { |
||
| 12 | private $value; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @throws Exception if value is invalid |
||
| 16 | */ |
||
| 17 | public function __construct(string $value) |
||
| 18 | { |
||
| 19 | $this->guard($value); |
||
| 20 | $this->value = $value; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function equals(StringValueObjectInterface $other): bool |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getValue(): string |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @throws Exception if value is invalid |
||
| 38 | */ |
||
| 39 | abstract protected function guard(string $value): void; |
||
| 40 | } |
||
| 41 |