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
Hi, and first thank you for this nice piece of software.
I read the suggestion in #744 and I agree that automatic conversion by default is not the way to go.
But on the other hand, the lack of conversion from environment variables to php scalar types makes the DI\env helper mostly unusable (except for strings) if you are using strict types.
I think one way to go might be to add a third optional parameter to DI\env specifying the type of variable you expect like DI\env("MY_VARIABLE",0,ENV_TYPE_INT) or DI\env("MY_VARIABLE",0,ENV_TYPE_INT), that third parameter would default to string, allowing backward compatibility.
The text was updated successfully, but these errors were encountered:
Hi, and first thank you for this nice piece of software.
I read the suggestion in #744 and I agree that automatic conversion by default is not the way to go.
But on the other hand, the lack of conversion from environment variables to php scalar types makes the
DI\env
helper mostly unusable (except for strings) if you are using strict types.I think one way to go might be to add a third optional parameter to
DI\env
specifying the type of variable you expect likeDI\env("MY_VARIABLE",0,ENV_TYPE_INT)
orDI\env("MY_VARIABLE",0,ENV_TYPE_INT)
, that third parameter would default to string, allowing backward compatibility.The text was updated successfully, but these errors were encountered: