Jade\Compiler\CompilerUtils::convertVarPathCallback PHP Method

convertVarPathCallback() protected static method

Return PHP code to translate dot to object/array getter.
protected static convertVarPathCallback ( array $match ) : string
$match array regex match
return string
    protected static function convertVarPathCallback($match)
    {
        if (empty($match[1])) {
            return $match[0];
        }
        $var = ($match[0] === ',' ? ',' : '') . $match[1];
        foreach (explode('.', substr($match[2], 1)) as $name) {
            if (!empty($name)) {
                $var = CommonUtils::getGetter($var, $name, false);
            }
        }
        return $var;
    }