can lazy property can return any type? #680
Unanswered
edgars-vasiljevs
asked this question in
Q&A
Replies: 1 comment
-
Correct types are being used if non-lazy, since lazy is an executed closure when transforming (toJson for example), we don't check it since it never will be set as a PHP property. We could check wether the outputted property is indeed what it should be but at the moment such functionality does not exist, you're always welcome to send in such a PR! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can return any type in lazy property callback. Defined
string
type is ignored.My understanding was that data objects ensure correct types are always returned. With lazy properties there is no guarantee of that.
Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions