mirror of
https://github.com/archtechx/enums.git
synced 2025-12-13 09:34:04 +00:00
feat: Add support for default values on metadata properties (#23)
refactor: Remove comment
This commit is contained in:
parent
a99ee1a7e0
commit
5be8a58974
4 changed files with 45 additions and 2 deletions
|
|
@ -12,6 +12,11 @@ abstract class MetaProperty
|
|||
$this->value = $this->transform($value);
|
||||
}
|
||||
|
||||
public static function defaultValue(): mixed
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function make(mixed $value): static
|
||||
{
|
||||
return new static($value);
|
||||
|
|
|
|||
|
|
@ -73,6 +73,6 @@ class Reflection
|
|||
return $properties[0]->value;
|
||||
}
|
||||
|
||||
return null;
|
||||
return $metaProperty::defaultValue() ?? null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue