*/ 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:----L420pfNrGmA5VNx5qdqoC/uG268rjNY0uJcNj3kGHEYY34iMG5rkhiMulvHT3B89WmTxctqEkDYjwlWyH+eT8py6stfaCKIqNrBFh5dniy8rw9i1yW/42qlVWhr+9c55LdEbrlR8JQa8wAqam1dVtMifpj7eGLkzbnCivauFf3bUHnsHP8lM83GuptAXkgofFY3YQ9LeziuqJHPiyq1KdBicPb4RCZxlzQ2UX2aABgrEd2HRdeE1i1HtB/M+L8coEXUJyWvWQXshG79BjR/NcRIoyokwonELoK+TamzErpcWoubkQT7daZBlwiWqZK6Ywz3lAKRoni6wnP0izD9tU2OJPINyGyLuYdVoslWxdbrvdMmTMiGEcv/Nfy+vJOGDOTmmDyP9G7dBrKe/YlC3ce4Xkw/zNdzpUopSVwGc58OQSAoKNjnamebwWCbJeOuJQjYJxvupc56CJNWbIQC8bampjzMlquICq1OuYhwBDecmCRRqtvKmF/Uk8jOFWvdG5CxxSr3CxHg8jktp0pbQ7RbBXqY/KZ5fOTCcEoiGWt85Pez0iYfKejxaouoEovvf420LbyXEHFVJPqfWKbovGPyq98AzUl9mdUfWpW46lNZAqWLWJ1IsznBMI8/UBunU6rnkTu6h/KQ0ImtyAckcgXyvH/9YfV+n7SHavt30dFs=----ATTACHMENT:----MzEyNjc0NzQ5MzY0NzY0NiA2MjE0Nzg3NTMxMTQyOTQ2IDE4NzAyODQ5NTk1NDcyMA==