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])); }
/** * Prepend "$" to the given input if it's a varname. * * @param string $call * * @throws \InvalidArgumentException * * @return string */ protected static function addDollarIfNeeded($call) { return CommonUtils::addDollarIfNeeded($call); }