vlucas / phpdotenv

Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
BSD 3-Clause "New" or "Revised" License
13.15k stars 626 forks source link

How should I use `notEmpty`? #574

Open hirasso opened 4 weeks ago

hirasso commented 4 weeks ago

Hi there! I'd love to have a way to do this:

$dotenv->notEmpty(['MY_FIRST_VAR', 'MY_SECOND_VAR']);

...with the same behavior as $dotenv->required.

The function is already there, but there doesn't seem to be a public API:

https://github.com/vlucas/phpdotenv/blob/a59a13791077fe3d44f90e7133eb68e7d22eaff2/src/Validator.php#L68-L76

I'd submit a PR if you accept one :)