Jade\Compiler\CommonUtils::getGetter PHP Method

getGetter() public static method

Return true if the ending quote of the string is escaped.
public static getGetter ( object | array $anything, $key ) : string
$anything object | array object or array (PHP >= 7) that contains a callable
return string
    public static function getGetter($anything, $key)
    {
        return '\\Jade\\Compiler::getPropertyFromAnything(' . static::addDollarIfNeeded($anything) . ', ' . var_export($key, true) . ')';
    }

Usage Example

Exemplo n.º 1
0
 protected function replaceInterpolationsInStrings($match)
 {
     $quote = $match[1];
     return str_replace('\\#{', '#{', preg_replace_callback('/(?<!\\\\)#{([^}]+)}/', function ($match) use($quote) {
         return $quote . ' . ' . CommonUtils::addDollarIfNeeded(preg_replace_callback('/(?<![a-zA-Z0-9_\\$])(\\$?[a-zA-Z_][a-zA-Z0-9_]*)\\.([a-zA-Z_][a-zA-Z0-9_]*)(?![a-zA-Z0-9_])/', function ($match) {
             return CommonUtils::getGetter($match[1], $match[2]);
         }, $match[1])) . ' . ' . $quote;
     }, $match[0]));
 }
All Usage Examples Of Jade\Compiler\CommonUtils::getGetter