Open joshua-bn opened 3 years ago
You're absolutely right that the docblock is incorrect. If you create a PR, someone will accept it (I can't, because I've left the company that maintains this).
It can't be a typehint on the signature though, because that would break the interface defined here: https://github.com/funeralzone/valueobjects/blob/master/src/ValueObject.php
The idea is that all value objects have the fromNative
and toNative
methods. If we type hinted in the signature to a string it would break other value objects whose fromNative
is not a string.
https://github.com/funeralzone/valueobjects/blob/master/src/Enums/EnumTrait.php#L53 should be string
Why not put the typehint on the signature?