src/Lms/SharedKernel/Domain/Identity/Uuid.php line 5

Open in your IDE?
  1. <?php
  2. namespace CodersLab\Lms\SharedKernel\Domain\Identity;
  3. final class Uuid extends AbstractId
  4. {
  5.     public function __construct(?string $id null)
  6.     {
  7.         parent::__construct($id ?? \Ramsey\Uuid\Uuid::uuid4()->toString());
  8.     }
  9.     protected function isValid(mixed $id): bool
  10.     {
  11.         return is_string($id) && \Ramsey\Uuid\Uuid::isValid($id);
  12.     }
  13. }