From a407eda42e8027406f06138a41485c89ebaf469e Mon Sep 17 00:00:00 2001 From: Cerys Date: Sun, 1 Dec 2024 15:21:08 +0000 Subject: [PATCH] quite and dirty class for the Deegraph UUID format --- src/DataStructures/UUID.php | 24 +++++++++++++++++++ src/Exceptions/InvalidUUIDFormatException.php | 17 +++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/DataStructures/UUID.php create mode 100644 src/Exceptions/InvalidUUIDFormatException.php diff --git a/src/DataStructures/UUID.php b/src/DataStructures/UUID.php new file mode 100644 index 0000000..13453c3 --- /dev/null +++ b/src/DataStructures/UUID.php @@ -0,0 +1,24 @@ +UUID = $uuid; + } else { + throw new InvalidUUIDFormatException(); + } + } + public function __toString(): string + { + return "{{$this->UUID}}"; + } +} diff --git a/src/Exceptions/InvalidUUIDFormatException.php b/src/Exceptions/InvalidUUIDFormatException.php new file mode 100644 index 0000000..3f0dbe0 --- /dev/null +++ b/src/Exceptions/InvalidUUIDFormatException.php @@ -0,0 +1,17 @@ +message = "$message"; + $this->code = $code; + } +}