@Test public void retrieve_symbol_by_tree() { ExpressionTree dollarAUsage = ((AssignmentExpressionTree) ((ExpressionStatementTree) ((FunctionDeclarationTree) cut.script().statements().get(5)).body().statements().get(3)).expression()).variable(); Symbol symbol = SYMBOL_MODEL.getSymbol(dollarAUsage); assertThat(symbol).isNotNull(); assertThat(symbol.name()).isEqualTo("$a"); }
Symbol getSymbol(QualifiedName qualifiedName) { return symbolByQualifiedName.get(qualifiedName); }
SymbolTableImpl implements SymbolTable { Symbol getSymbol(QualifiedName qualifiedName) { return symbolByQualifiedName.get(qualifiedName); } }
SymbolTableImpl implements SymbolTable { Symbol getSymbol(QualifiedName qualifiedName) { return symbolByQualifiedName.get(qualifiedName); } private  SymbolTableImpl(); }
SymbolTableImpl implements SymbolTable { Symbol getSymbol(QualifiedName qualifiedName) { return symbolByQualifiedName.get(qualifiedName); } private  SymbolTableImpl(); static SymbolTableImpl create(CompilationUnitTree compilationUnit); static SymbolTableImpl create(CompilationUnitTree compilationUnit, ProjectSymbolData projectSymbolData, @Nullable PhpFile file); @Override ImmutableSet<Scope> getScopes(); @Nullable @Override Scope getScopeFor(Tree tree); ImmutableList<Symbol> getSymbols(); @Override List<Symbol> getSymbols(Symbol.Kind kind); List<Symbol> getSymbols(String name); @Override @CheckForNull Symbol getSymbol(Tree tree); Collection<ClassSymbolData> classSymbolDatas(); Collection<FunctionSymbolData> functionSymbolDatas(); }
SymbolTableImpl implements SymbolTable { Symbol getSymbol(QualifiedName qualifiedName) { return symbolByQualifiedName.get(qualifiedName); } private  SymbolTableImpl(); static SymbolTableImpl create(CompilationUnitTree compilationUnit); static SymbolTableImpl create(CompilationUnitTree compilationUnit, ProjectSymbolData projectSymbolData, @Nullable PhpFile file); @Override ImmutableSet<Scope> getScopes(); @Nullable @Override Scope getScopeFor(Tree tree); ImmutableList<Symbol> getSymbols(); @Override List<Symbol> getSymbols(Symbol.Kind kind); List<Symbol> getSymbols(String name); @Override @CheckForNull Symbol getSymbol(Tree tree); Collection<ClassSymbolData> classSymbolDatas(); Collection<FunctionSymbolData> functionSymbolDatas();  }