Documentation

EnvironmentVariableDefinition
in package
implements Definition

Defines a reference to an environment variable, with fallback to a default value if the environment variable is not defined.

Tags
author

James Harris james.harris@icecave.com.au

Table of Contents

Interfaces

Definition

Properties

$defaultValue  : mixed
$isOptional  : bool
$name  : string
Entry name.
$variableName  : string

Methods

__construct()  : mixed
__toString()  : string
getDefaultValue()  : mixed
getName()  : string
getVariableName()  : string
isOptional()  : bool
replaceNestedDefinitions()  : void
setName()  : void

Properties

Methods

__construct()

public __construct(string $variableName[, bool $isOptional = false ][, mixed $defaultValue = null ]) : mixed
Parameters
$variableName : string

The name of the environment variable

$isOptional : bool = false

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.

$defaultValue : mixed = null

The default value to use if the environment variable is optional and not provided

getDefaultValue()

public getDefaultValue() : mixed
Return values
mixed

The default value to use if the environment variable is optional and not provided

isOptional()

public isOptional() : bool
Return values
bool

Whether or not the environment variable definition is optional


        
On this page

Search results