You are here

protected function JSqueeze::getNewName in Advanced CSS/JS Aggregation 7.2

Same name and namespace in other branches
  1. 8.4 advagg_js_minify/jsqueeze.inc \Patchwork\JSqueeze::getNewName()
  2. 8.2 advagg_js_minify/jsqueeze.inc \Patchwork\JSqueeze::getNewName()
  3. 8.3 advagg_js_minify/jsqueeze.inc \Patchwork\JSqueeze::getNewName()

File

advagg_js_compress/jsqueeze.inc, line 1033

Class

JSqueeze

Namespace

Patchwork

Code

protected function getNewName($m) {
  $m = $m[0];
  $pre = '.' === $m[0] ? '.' : '';
  $post = '';
  if (',' === $m[0] || '{' === $m[0] || ' ' === $m[0]) {
    $pre = $m[0];
    if (':' === substr($m, -1)) {
      $post = ':';
      $m = (' ' !== $m[0] ? '.' : '') . substr($m, 1, -1);
    }
    elseif ('get ' === substr($m, 1, 4) || 'set ' === substr($m, 1, 4)) {
      $pre .= substr($m, 1, 4);
      $m = '.' . substr($m, 5);
    }
    else {
      $m = substr($m, 1);
    }
  }
  elseif (':' === substr($m, -1)) {
    $post = ':';
    $m = substr($m, 0, -1);
  }
  $post = (isset($this->reserved[$m]) ? 'true' === $m ? '!0' : ('false' === $m ? '!1' : $m) : (isset($this->local_tree[$m]) ? $this->local_tree[$m] : (isset($this->used_tree[$m]) ? $this->used_tree[$m] : $m))) . $post;
  return '' === $post ? '' : $pre . ('.' === $post[0] ? substr($post, 1) : $post);
}