function getScopeName() { $parentClassScope = $this->currentScope->findAncestorScopeByType(CODE_SCOPE_CLASS); if ($parentClassScope != null) { return "this." . $this->currentScope->getName(); } return $this->currentScope->getName(); }
function findAncestorScopeByType($type) { if ($this->parentScope == null) { return null; } if ($this->parentScope->getType() == $type) { return $this->parentScope; } return $this->parentScope->findAncestorScopeByType($type); }