More polish
parent
3131a9c172
commit
54073c56fc
|
@ -156,11 +156,17 @@ class TreeAnalyzer
|
|||
$this->collectDefinitionsAndReferences($node);
|
||||
}
|
||||
|
||||
public function getDiagnostics()
|
||||
/**
|
||||
* @return Diagnostic[]
|
||||
*/
|
||||
public function getDiagnostics(): array
|
||||
{
|
||||
return $this->diagnostics ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function addReference(string $fqn, Node $node)
|
||||
{
|
||||
if (!isset($this->referenceNodes[$fqn])) {
|
||||
|
@ -169,21 +175,33 @@ class TreeAnalyzer
|
|||
$this->referenceNodes[$fqn][] = $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Definition
|
||||
*/
|
||||
public function getDefinitions()
|
||||
{
|
||||
return $this->definitions ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Node[]
|
||||
*/
|
||||
public function getDefinitionNodes()
|
||||
{
|
||||
return $this->definitionNodes ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Node[]
|
||||
*/
|
||||
public function getReferenceNodes()
|
||||
{
|
||||
return $this->referenceNodes ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Node[]
|
||||
*/
|
||||
public function getStmts()
|
||||
{
|
||||
return $this->stmts;
|
||||
|
|
|
@ -68,7 +68,7 @@ class DefinitionCollectorTest extends TestCase
|
|||
/**
|
||||
* @param $path
|
||||
*/
|
||||
private function collectDefinitions($path): array
|
||||
private function collectDefinitions(string $path): array
|
||||
{
|
||||
$uri = pathToUri($path);
|
||||
$parser = new PhpParser\Parser();
|
||||
|
|
Loading…
Reference in New Issue