Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 967 Bytes

File metadata and controls

42 lines (29 loc) · 967 Bytes

Interpolation Usage

Interpolation is applied after all selected config files have been parsed and merged.

Supported Syntax

${VAR}
${VAR:-default}

Example

database:
  host: ${DB_HOST:-localhost}
  user: ${DB_USER}
  dsn: mysql:host=${DB_HOST:-localhost};dbname=app

Expected Behavior

  • ${DB_HOST:-localhost} resolves to the environment value when present
  • otherwise it resolves to localhost
  • ${DB_USER} must exist in the environment
  • the final values remain strings

Failure Cases

  • missing variable without default throws MissingEnvironmentVariableException
  • invalid unresolved placeholder content throws ConfigException

Notes

  • interpolation only affects string values
  • booleans, numbers, null, and arrays are not cast or transformed

Related Documents