josegonzalez/php-dotenv

expect after to... function

fzerorubigd opened this issue · 1 comments

I want to load my databbase credential (for example) from env. and they are important so I put them in expect array. in development every thing is ok, since I have all of them inside my .env file but in production there is an env variable out there with the correct value.
I want to remove the line from my .env file, but I get exception on load. I think, the correct place for check that is after toEnv (in my case and toServer and other toMethods)
I mean after toEnv if there is no "expected" variable in $_ENV (or $_SERVER in toServer and ...) I should get an exception, not becuse I have none of them inside my .env file.

This is simple to implement but I want to know if you have anything else in mind?

Feel free to make a PR for your feature request, and include tests.