@Test public void undeclared_class_usage_in_namespace() { SymbolTableImpl symbolTable = symbolTableFor("<?php namespace A { $a = new A('odbc:sample', 'db2inst1', 'ibmdb2'); }"); Symbol symbol = symbolTable.getSymbol("A\\A"); assertThat(symbol).isInstanceOf(UndeclaredSymbol.class); SyntaxToken usage = Iterables.getOnlyElement(symbol.usages()); assertThat(usage.line()).isEqualTo(1); assertThat(usage.column()).isEqualTo(30); }
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();  }