You are here

protected function JSqueeze::getNextName in Advanced CSS/JS Aggregation 8.4

Same name and namespace in other branches
  1. 8.2 advagg_js_minify/jsqueeze.inc \Patchwork\JSqueeze::getNextName()
  2. 8.3 advagg_js_minify/jsqueeze.inc \Patchwork\JSqueeze::getNextName()
  3. 7.2 advagg_js_compress/jsqueeze.inc \Patchwork\JSqueeze::getNextName()
1 call to JSqueeze::getNextName()
JSqueeze::renameVars in advagg_js_minify/jsqueeze.inc

File

advagg_js_minify/jsqueeze.inc, line 964

Class

JSqueeze

Namespace

Patchwork

Code

protected function getNextName(&$tree = array(), &$counter = false) {
  if (false === $counter) {
    $counter =& $tree['counter'];
    isset($counter) || ($counter = -1);
    $exclude = array_flip($tree['used']);
  }
  else {
    $exclude = $tree;
  }
  ++$counter;
  $len0 = strlen($this->str0);
  $len1 = strlen($this->str0);
  $name = $this->str0[$counter % $len0];
  $i = intval($counter / $len0) - 1;
  while ($i >= 0) {
    $name .= $this->str1[$i % $len1];
    $i = intval($i / $len1) - 1;
  }
  return !(isset($this->reserved[$name]) || isset($exclude[$name])) ? $name : $this
    ->getNextName($exclude, $counter);
}