| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | abstract class AggregateId |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * Identifier. |
||
| 25 | * |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $id; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return static |
||
| 32 | */ |
||
| 33 | 10 | public static function new(): self |
|
| 34 | { |
||
| 35 | 10 | return new static(uuid()); |
|
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @throws \ServiceBus\EventSourcing\Exceptions\InvalidAggregateIdentifier |
||
| 40 | */ |
||
| 41 | 11 | final public function __construct(string $id) |
|
| 49 | 10 | } |
|
| 50 | |||
| 51 | 10 | public function toString(): string |
|
| 56 |