ILIAS  release_7 Revision v7.30-3-g800a261c036
Factory.php
Go to the documentation of this file.
1<?php
2
4
5use Exception;
6use Ramsey\Uuid\UuidFactory;
7
15{
16
17
22
26 public function __construct()
27 {
28 $this->uuid_factory = new UuidFactory();
29 }
30
35 public function uuid4() : Uuid
36 {
37 return new RamseyUuidWrapper($this->uuid_factory->uuid4());
38 }
39
44 public function uuid4AsString() : string
45 {
46 return $this->uuid4()->toString();
47 }
48
53 public function fromString(string $uuid) : Uuid
54 {
55 return new RamseyUuidWrapper($this->uuid_factory->fromString($uuid));
56 }
57}
An exception for terminatinating execution or to throw for unit testing.
__construct()
Factory constructor.
Definition: Factory.php:26
fromString(string $uuid)
Definition: Factory.php:53