| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class Name |
||
| 10 | { |
||
| 11 | private $value; |
||
| 12 | |||
| 13 | 14 | public function __construct(string $value) |
|
| 14 | { |
||
| 15 | 14 | if (Str::of($value)->empty()) { |
|
| 16 | 1 | throw new DomainException; |
|
| 17 | } |
||
| 18 | |||
| 19 | 13 | $this->value = $value; |
|
| 20 | 13 | } |
|
| 21 | |||
| 22 | 4 | public function equals(self $name): bool |
|
| 23 | { |
||
| 24 | 4 | return (string) $this === (string) $name; |
|
| 25 | } |
||
| 26 | |||
| 27 | 5 | public function __toString(): string |
|
| 30 | } |
||
| 31 | } |
||
| 32 |