WIP on docs and added basic enums supports
This commit is contained in:
1 parent
497fe5547b
commit
b6752f4364
22 files changed
+367
-35
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user