ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Factory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Exception;
24use Ramsey\Uuid\UuidFactory;
25
33{
34 private UuidFactory $uuid_factory;
35
36 public function __construct()
37 {
38 $this->uuid_factory = new UuidFactory();
39 }
40
41 public function uuid4(): Uuid
42 {
43 return new RamseyUuidWrapper($this->uuid_factory->uuid4());
44 }
45
46 public function uuid4AsString(): string
47 {
48 return $this->uuid4()->toString();
49 }
50
51 public function fromString(string $uuid): Uuid
52 {
53 return new RamseyUuidWrapper($this->uuid_factory->fromString($uuid));
54 }
55}
fromString(string $uuid)
Definition: Factory.php:51
UuidFactory $uuid_factory
Definition: Factory.php:34