WIP on docs and added basic enums supports

This commit is contained in:
mcndave committed 2023-01-14 02:19:42 +00:00
1 parent 497fe5547b
commit b6752f4364
22 files changed
+367 -35

No files matched your search

+10 -1
View File
@@ -27,7 +27,16 @@ class ObjectInstanciator {
return (string) $obj;
}
public function enum(\UnitEnum $obj)
{
if (! $obj instanceof \BackedEnum) {
throw new \Ulmus\Exception\BackedEnumRequired("Unable to extract a UnitEnum value from this variable. You must define your enum as a BackedEnum instead of an UnitEnum.");
}
return $obj->value;
}
public function registerObject(string $type, Callable $callback) : void
{
$this->objectCallbackDefinition[$type] = $callback;