Same name in other branches
- 5.0.x advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 6.0.x advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 7.x-1.x advagg_js_compress/jspacker.inc \ParseMaster::_replacement()
- 8.x-2.x advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 8.x-3.x advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 8.x-4.x advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
Fichier
-
advagg_js_compress/
jspacker.inc, line 675
Classe
Code
private function _replacement($arguments) {
if (empty($arguments)) {
return '';
}
$i = 1;
$j = 0;
// loop through the patterns
while (isset($this->_patterns[$j])) {
$pattern = $this->_patterns[$j++];
// do we have a result?
if (isset($arguments[$i]) && $arguments[$i] != '') {
$replacement = $pattern[self::REPLACEMENT];
if (is_array($replacement) && isset($replacement['fn'])) {
if (isset($replacement['data'])) {
$this->buffer = $replacement['data'];
}
return call_user_func(array(
&$this,
$replacement['fn'],
), $arguments, $i);
}
elseif (is_int($replacement)) {
return $arguments[$replacement + $i];
}
$delete = $this->escapeChar == '' || strpos($arguments[$i], $this->escapeChar) === false ? '' : "\x01" . $arguments[$i] . "\x01";
return $delete . $replacement;
// skip over references to sub-expressions
}
else {
$i += $pattern[self::LENGTH];
}
}
}