Env-Interop Now Open For Public Review
After a brief round of private review, the Env-Interop standard interface package is now open for public review.
Env-Interop provides interoperable interfaces to load and parse environment files, and encapsulate environment variables, in PHP 8.4 or later. It reflects, refines, and reconciles the common practices identified within several pre-existing projects to define these interfaces:
-
EnvLoaderService affords loading environment variables parsed from an environment file into
$_ENV(and possibly elsewhere). -
EnvParserService affords parsing a string for environment variables.
-
EnvSetterService affords adding or replacing an environment variable in
$_ENV(and possibly elsewhere). -
EnvGetter affords getting environment variable values.
-
EnvThrowable interface extends Throwable to mark an Exception as environment-related.
-
EnvTypeAliases provides PHPStan type aliases to aid static analysis.
The reference implementations demonstrate how the interfaces can be used.
If you have to deal with environment variables and are interested an interoperable set of interfaces, please offer your comments and criticism as issues or PRs out at Github.