*/ class EnvironmentVariableDefinition implements Definition { /** * Entry name. * @var string */ private $name = ''; /** * The name of the environment variable. * @var string */ private $variableName; /** * Whether or not the environment variable definition is optional. * * If true and the environment variable given by $variableName has not been * defined, $defaultValue is used. * * @var bool */ private $isOptional; /** * The default value to use if the environment variable is optional and not provided. * @var mixed */ private $defaultValue; /** * @param string $variableName The name of the environment variable * @param bool $isOptional Whether or not the environment variable definition is optional * @param mixed $defaultValue The default value to use if the environment variable is optional and not provided */ public function __construct(string $variableName, bool $isOptional = false, $defaultValue = null) { $this->variableName = $variableName; $this->isOptional = $isOptional; $this->defaultValue = $defaultValue; } public function getName(): string { return $this->name; } public function setName(string $name) { $this->name = $name; } /** * @return string The name of the environment variable */ public function getVariableName(): string { return $this->variableName; } /** * @return bool Whether or not the environment variable definition is optional */ public function isOptional(): bool { return $this->isOptional; } /** * @return mixed The default value to use if the environment variable is optional and not provided */ public function getDefaultValue() { return $this->defaultValue; } public function replaceNestedDefinitions(callable $replacer) { $this->defaultValue = $replacer($this->defaultValue); } public function __toString() { $str = ' variable = ' . $this->variableName . \PHP_EOL . ' optional = ' . ($this->isOptional ? 'yes' : 'no'); if ($this->isOptional) { if ($this->defaultValue instanceof Definition) { $nestedDefinition = (string) $this->defaultValue; $defaultValueStr = str_replace(\PHP_EOL, \PHP_EOL . ' ', $nestedDefinition); } else { $defaultValueStr = var_export($this->defaultValue, true); } $str .= \PHP_EOL . ' default = ' . $defaultValueStr; } return sprintf('Environment variable (' . \PHP_EOL . '%s' . \PHP_EOL . ')', $str); } } __halt_compiler();----SIGNATURE:----QTVVjmf0dXJT7msjELscNQTZvV9IGvEK5x7rRBWWtCWUXLrHagJbyqZnhg+XZaHrc7xBypC2Pk+RZIX9+rU3sCSCBvxxmKVMRdFefJwwTebgnuCW4ydTdFP7T5Pavmx9OZ4dBrNBbKeGeW0nGDhHMBmkko4SUwF1okdPSiRpxbd0ldzJCWEUrs1k8N0VScEJZDnpNtJJnvBldfzvhtIPqYT73Fu0O/pRkjKUdHwxG1la03ByZGhT/3KgiAiXkBtGN8qeWsLKyND2HavDO8aCI7nDVFik4BwOe36WU5oSv60hgzWNK2YLRAutr/k0RXMaS2+reYZsUzwp7/C1fBUFzwceMrOkQgPe9z3GZSYV/DfLle1lT3Bd1VDdmUmFCjPt5qehmG7XShoPDlVqm6A6Z9+DGjMmqPHX1eTZTlhZKrzOzKuj6Gtv90C26U0dLrG3g+B41qicaHY93Ux/ptnpuXmxI5/him8s/qOc7xaxKrE6A/Px+/qeaNR0nodFIcpjIylnnldk4CtjGzbLmbSfhELV95mGaYzuv3+h27orYIpqJAVcZr2oGCyrzV+rEdNuWEeGDqwYeQGzxE8lQa8SbQbXTQz8l2DDikxUyQmoYaJ6xfClKhi+BqfmiMOTWDjL4GWl6CGZHbkwk0A6wgGuDEDzJ0uOHHk3SYyJ5PZD6Qk=----ATTACHMENT:----NzI3OTc5NDUzMTQzMzM5NiA5ODEyODU4NDA4NTYzOTgwIDY3NDg2ODIyODc5NTEwNA==