*/ 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:----Nmq7EHF024EP91N3n9VjuRS0Qs9EsZjkxhafIDQzefGvbfTVMR0lBrz1xF7DIDVP+E5sGSiPvSRg0c3+jsgT63Ai95TUCzhKBd38UWzBwVIR3N0kmppyAr3frxB/NCYbBlWU+V6Hjg5umxVkJjUztrvKLyzBfK8E0CXlMj5ukm9Va5ZpOfjbYi47ryzijqCCCsA3QINH/DfLIrpuNu7GvOPA2Z/HGETaZRjvVMw7QoqzfUPT5hJL9UZOuz0ROkdjdIfxHIhjr1XZAON5g1/ZkIBkyAuR+gWuFPNVXVxqTOxZPogQp5+Z/IX31YwsCQ989WWRG74MYEgTy+ph4i1ObkaIzRvAzcWgml3HJvwKvtvIkwmD8/MTHi3dQVKGL0QUOHoS7c950rHvC0O3EiPTboD3+4Tvg+pP6ZJX9RCWEaiHmrufCrG3bDq/Zw0ZT55wnTC8Sgo9heAeScF0jgURZhfsoTeeXvtg6UsosUfVJj2MKykBUVTOzrHmEt8zW+vDXmttrjnXsoBjQQ8S19s4qAmdkziuuwytc/UY3PPTA8mzQoRSIpiQtYGUW+qXJDHHTG9WuWK/KBrTmLGM8xUfCzcZY3uB9QOhr6/+bbiS3QG1YDFi7Aa+CsJlNeiSqK90nBtJZgxWqpS6MIU937gCyHPA38X12mRUBiooaoFX9Uk=----ATTACHMENT:----MzQ5NjA0NDg1Mzg4MjU0NyA1NTM1OTM0NDA3Njc2NjY1IDg5OTEwNDcwOTM4NjI1OTU=