Skip to content
docsv0.17.0

ResolvedEnv

One declared environment variable after the rule decided where its value comes from. The rule is the same for the card and for the compose file, so it lives once, in precedence order: a `secret` has no value here, ever — the contract refuses a secret that carries a literal, and this class masks one anyway as defense in depth; a `configKey` the app's config holds yields that value (`config`); a literal the plugin wrote yields it (`literal`); anything else is `unset` — the operator supplies it. Whatever has no value is projected as `${NAME}`.

ResolvedEnv::__construct()

public function __construct(string $name, string $source, ?string $value, ?string $configKey):

Parameters

Parameters of __construct()
NameTypeDescription
$namestringthe variable as the container reads it
$sourcestringone of {@see self::LITERAL}, {@see self::CONFIG}, {@see self::SECRET}, {@see self::UNSET}
$value(string | null)the value a reader may show and inline, null for secrets and unset variables
$configKey(string | null)the app config key the plugin pointed at, when it did

ResolvedEnv::of()

public static function of(Milpa\Runtime\Stack\EnvVar $var, ?Milpa\Runtime\Config $config): self

Applies the rule to one declaration against the app's config bag (absent when the caller has none).

Parameters

Parameters of of()
NameTypeDescription
$varMilpa\Runtime\Stack\EnvVar
$config?Milpa\Runtime\Config

ResolvedEnv::composeValue()

public function composeValue(): string

The compose `environment:` value — the resolved string, or `${NAME}` when the operator supplies it. Compose interpolates `$` in every value, so an inlined value escapes each `$` as `$$` and reads back as the bytes the app holds; only the deliberate `${NAME}` placeholder is left for compose to substitute.