EnvironmentInterpolator applies environment variable replacement to the merged config array.
- traverse the merged array recursively
- interpolate string values
- leave non-string values unchanged
- throw when required environment variables are missing
- merged
array<mixed> - an
EnvironmentReaderInterfaceimplementation
- interpolated
array<mixed>
${VAR}
${VAR:-default}
- strings may contain placeholders as the whole value or inline inside larger strings
- defaults are used only when the environment variable is absent
- values remain strings after interpolation
- arrays are traversed recursively
The default reader is PhpEnvironmentReader, which checks:
getenv()$_ENV$_SERVER
- no expression evaluation
- no implicit type casting
- invalid unresolved placeholder syntax is rejected