Leafo\ScssPhp\Compiler::setExisting PHP Method

setExisting() protected method

Set existing variable
protected setExisting ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env )
$name string
$value mixed
$env Leafo\ScssPhp\Compiler\Environment
    protected function setExisting($name, $value, Environment $env)
    {
        $storeEnv = $env;
        $hasNamespace = $name[0] === '^' || $name[0] === '@' || $name[0] === '%';
        for (;;) {
            if (array_key_exists($name, $env->store)) {
                break;
            }
            if (!$hasNamespace && isset($env->marker)) {
                $env = $storeEnv;
                break;
            }
            if (!isset($env->parent)) {
                $env = $storeEnv;
                break;
            }
            $env = $env->parent;
        }
        $env->store[$name] = $value;
    }
Compiler