ILIAS  release_8 Revision v8.24
Factory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
6
7use Exception;
8use Ramsey\Uuid\UuidFactory;
9
17{
18 private UuidFactory $uuid_factory;
19
20 public function __construct()
21 {
22 $this->uuid_factory = new UuidFactory();
23 }
24
25 public function uuid4(): Uuid
26 {
27 return new RamseyUuidWrapper($this->uuid_factory->uuid4());
28 }
29
30 public function uuid4AsString(): string
31 {
32 return $this->uuid4()->toString();
33 }
34
35 public function fromString(string $uuid): Uuid
36 {
37 return new RamseyUuidWrapper($this->uuid_factory->fromString($uuid));
38 }
39}
fromString(string $uuid)
Definition: Factory.php:35
UuidFactory $uuid_factory
Definition: Factory.php:18