test_class.declarator: SYMBOL_TABLE = SymbolTableImpl.create(parse("symbols/scopes.php"))
test_class.modifier: private final
test_class.original_string: private final SymbolTableImpl SYMBOL_TABLE = SymbolTableImpl.create(parse("symbols/scopes.php"));
test_class.type: SymbolTableImpl
test_class.var_name: SYMBOL_TABLE
test_class.file: php-frontend/src/test/java/org/sonar/php/tree/symbols/ScopeTest.java
test_class.identifier: ScopeTest
test_class.superclass: extends ParsingTestUtils
test_case.body: @Test
    public void method_scope() throws Exception {
      Scope methodScope = getScopeFor(Kind.METHOD_DECLARATION);
  
      assertThat(methodScope.getSymbol("$g")).isNotNull();
    }
test_case.class_method_signature: ScopeTest.method_scope()
test_case.full_signature: @Test public void method_scope()
test_case.identifier: method_scope
test_case.invocations: getScopeFor isNotNull assertThat getSymbol
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void method_scope()
focal_class.declarator: outer
focal_class.modifier: private final
focal_class.original_string: private final Scope outer;
focal_class.type: Scope
focal_class.var_name: outer
focal_class.declarator: tree
focal_class.modifier: private final
focal_class.original_string: private final Tree tree;
focal_class.type: Tree
focal_class.var_name: tree
focal_class.declarator: symbols = new ArrayList<>()
focal_class.modifier: protected
focal_class.original_string: protected List<Symbol> symbols = new ArrayList<>();
focal_class.type: List<Symbol>
focal_class.var_name: symbols
focal_class.declarator: superClassScope
focal_class.original_string: Scope superClassScope;
focal_class.type: Scope
focal_class.var_name: superClassScope
focal_class.declarator: unresolvedCompact
focal_class.modifier: private
focal_class.original_string: private boolean unresolvedCompact;
focal_class.type: boolean
focal_class.var_name: unresolvedCompact
focal_class.declarator: captureOuterScope
focal_class.modifier: private
focal_class.original_string: private boolean captureOuterScope;
focal_class.type: boolean
focal_class.var_name: captureOuterScope
focal_class.file: php-frontend/src/main/java/org/sonar/php/tree/symbols/Scope.java
focal_class.identifier: Scope
focal_class.class_method_signature: Scope.Scope(Scope outer, Tree tree, boolean captureOuterScope)
focal_class.full_signature: public  Scope(Scope outer, Tree tree, boolean captureOuterScope)
focal_class.identifier: Scope
focal_class.modifiers: public
focal_class.parameters: (Scope outer, Tree tree, boolean captureOuterScope)
focal_class.signature:  Scope(Scope outer, Tree tree, boolean captureOuterScope)
focal_class.class_method_signature: Scope.Scope(CompilationUnitTree compilationUnitTree)
focal_class.full_signature: public  Scope(CompilationUnitTree compilationUnitTree)
focal_class.identifier: Scope
focal_class.modifiers: public
focal_class.parameters: (CompilationUnitTree compilationUnitTree)
focal_class.signature:  Scope(CompilationUnitTree compilationUnitTree)
focal_class.class_method_signature: Scope.tree()
focal_class.full_signature: public Tree tree()
focal_class.identifier: tree
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Tree
focal_class.signature: Tree tree()
focal_class.class_method_signature: Scope.outer()
focal_class.full_signature: public Scope outer()
focal_class.identifier: outer
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Scope
focal_class.signature: Scope outer()
focal_class.class_method_signature: Scope.getSymbols(Symbol.Kind kind)
focal_class.full_signature: public List<Symbol> getSymbols(Symbol.Kind kind)
focal_class.identifier: getSymbols
focal_class.modifiers: public
focal_class.parameters: (Symbol.Kind kind)
focal_class.return: List<Symbol>
focal_class.signature: List<Symbol> getSymbols(Symbol.Kind kind)
focal_class.class_method_signature: Scope.isGlobal()
focal_class.full_signature: public boolean isGlobal()
focal_class.identifier: isGlobal
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isGlobal()
focal_class.class_method_signature: Scope.addSymbol(Symbol symbol)
focal_class.full_signature: public void addSymbol(Symbol symbol)
focal_class.identifier: addSymbol
focal_class.modifiers: public
focal_class.parameters: (Symbol symbol)
focal_class.return: void
focal_class.signature: void addSymbol(Symbol symbol)
focal_class.class_method_signature: Scope.getSymbol(String name, Kind... kinds)
focal_class.full_signature: @Nullable public Symbol getSymbol(String name, Kind... kinds)
focal_class.identifier: getSymbol
focal_class.modifiers: @Nullable public
focal_class.parameters: (String name, Kind... kinds)
focal_class.return: Symbol
focal_class.signature: Symbol getSymbol(String name, Kind... kinds)
focal_class.class_method_signature: Scope.setUnresolvedCompact(boolean unresolvedCompact)
focal_class.full_signature:  void setUnresolvedCompact(boolean unresolvedCompact)
focal_class.identifier: setUnresolvedCompact
focal_class.parameters: (boolean unresolvedCompact)
focal_class.return: void
focal_class.signature: void setUnresolvedCompact(boolean unresolvedCompact)
focal_class.class_method_signature: Scope.hasUnresolvedCompact()
focal_class.full_signature: public boolean hasUnresolvedCompact()
focal_class.identifier: hasUnresolvedCompact
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasUnresolvedCompact()
focal_method.body: @Nullable
    public Symbol getSymbol(String name, Kind... kinds) {
      List<Kind> kindList = Arrays.asList(kinds);
      List<Symbol> result = new ArrayList<>();
      for (Symbol s : symbols) {
        if (s.called(name)) {
          if (kindList.isEmpty() || kindList.contains(s.kind())) {
            result.add(s);
          } else if (s.is(Kind.PARAMETER) && kindList.equals(Collections.singletonList(Kind.VARIABLE))) {
            // parameter of a child scope shadows variable of the outer scope
            return null;
          }
        }
      }
      if (result.isEmpty()) {
        if (superClassScope != null) {
          return superClassScope.getSymbol(name, kinds);
        } else if (captureOuterScope) {
          return outer.getSymbol(name, kinds);
        }
      }
  
      return result.size() == 1 ? result.get(0) : null;
    }
focal_method.class_method_signature: Scope.getSymbol(String name, Kind... kinds)
focal_method.full_signature: @Nullable public Symbol getSymbol(String name, Kind... kinds)
focal_method.identifier: getSymbol
focal_method.invocations: asList called isEmpty contains kind add is equals singletonList isEmpty getSymbol getSymbol size get
focal_method.modifiers: @Nullable public
focal_method.parameters: (String name, Kind... kinds)
focal_method.return: Symbol
focal_method.signature: Symbol getSymbol(String name, Kind... kinds)