/opt/cpanel/ea-wappspector/vendor/php-di/php-di/src/Definition
NameSizeModeActions
Dumper/-0755rm
Exception/-0755rm
Helper/-0755rm
ObjectDefinition/-0755rm
Resolver/-0755rm
Source/-0755rm
ArrayDefinition.php13390644editdlrm
ArrayDefinitionExtension.php10170644editdlrm
AutowireDefinition.php1700644editdlrm
DecoratorDefinition.php7820644editdlrm
Definition.php8470644editdlrm
EnvironmentVariableDefinition.php25640644editdlrm
ExtendsPreviousDefinition.php3230644editdlrm
FactoryDefinition.php17580644editdlrm
InstanceDefinition.php11460644editdlrm
ObjectDefinition.php64480644editdlrm
Reference.php13160644editdlrm
SelfResolvingDefinition.php5280644editdlrm
StringDefinition.php22590644editdlrm
ValueDefinition.php11400644editdlrm
Edit: /opt/cpanel/ea-wappspector/vendor/php-di/php-di/src/Definition/EnvironmentVariableDefinition.php (2564B)
*/ class EnvironmentVariableDefinition implements Definition { /** Entry name. */ private string $name = ''; /** * @param string $variableName The name of the environment variable * @param bool $isOptional 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. * @param mixed $defaultValue The default value to use if the environment variable is optional and not provided */ public function __construct( private string $variableName, private bool $isOptional = false, private mixed $defaultValue = null, ) { } public function getName() : string { return $this->name; } public function setName(string $name) : void { $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() : mixed { return $this->defaultValue; } public function replaceNestedDefinitions(callable $replacer) : void { $this->defaultValue = $replacer($this->defaultValue); } public function __toString() : string { $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); } }