Leafo\ScssPhp\Compiler::callScssFunction PHP Method

callScssFunction() protected method

Call SCSS @function
protected callScssFunction ( string $name, $argValues, array &$returnValue ) : boolean
$name string
$returnValue array
return boolean Returns true if returnValue is set; otherwise, false
    protected function callScssFunction($name, $argValues, &$returnValue)
    {
        $func = $this->get(static::$namespaces['function'] . $name, false);
        if (!$func) {
            return false;
        }
        $this->pushEnv();
        $storeEnv = $this->storeEnv;
        $this->storeEnv = $this->env;
        // set the args
        if (isset($func->args)) {
            $this->applyArguments($func->args, $argValues);
        }
        // throw away lines and children
        $tmp = new OutputBlock();
        $tmp->lines = [];
        $tmp->children = [];
        $this->env->marker = 'function';
        $ret = $this->compileChildren($func->children, $tmp);
        $this->storeEnv = $storeEnv;
        $this->popEnv();
        $returnValue = !isset($ret) ? static::$defaultValue : $ret;
        return true;
    }
Compiler