You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is there a supported way to only enable type juggling for scalars? or some kind of api we should use?
our use-case: we want to convert from $_GET or $_POST which is always string and need to map it into objects which e.g. expect int.
it seems valinor is already able so we can easily define per class how data needs to be mapped to said class, but it seems to miss some kind of "general conversion" building blocks for scalar types only.
The text was updated successfully, but these errors were encountered:
Hi @staabm, thanks for the report. For now it is not possible to distinguish the scalar casting from the other cases. I definitely see the value in your usecase and will be thinking about how to extend the current API.
we would want to have type juggling from e.g.
numeric-strings
intoint
; same forfloat
fromstring
(just like regular php cast rules).we found the
enableFlexibleCasting
to achieve it,but it also enables some kind of list<->array juggling, which we would not want:
is there a supported way to only enable type juggling for scalars? or some kind of api we should use?
our use-case: we want to convert from
$_GET
or$_POST
which is alwaysstring
and need to map it into objects which e.g. expectint
.it seems valinor is already able so we can easily define per class how data needs to be mapped to said class, but it seems to miss some kind of "general conversion" building blocks for scalar types only.
The text was updated successfully, but these errors were encountered: