M1\Vars\Variables\VariableProvider::checkVariableExists PHP Method

checkVariableExists() private method

Checks to see if the variable exists
private checkVariableExists ( string $variable, string $type ) : boolean
$variable string The variable to check
$type string The variable type
return boolean Does the variable exist
    private function checkVariableExists($variable, $type)
    {
        if ($type === 'env' && !getenv($variable) || $type === 'replacement' && !$this->rstore->arrayKeyExists($variable) || $type === 'variable' && !$this->vstore->arrayKeyExists($variable)) {
            throw new \InvalidArgumentException(sprintf('Variable has not been defined as a `%s`: %s', $variable, $type));
        }
        return true;
    }