1
0
Fork 0

More polish

pull/357/head
Felix Becker 2017-06-08 14:50:59 +02:00
parent 3131a9c172
commit 54073c56fc
2 changed files with 20 additions and 2 deletions

View File

@ -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;

View File

@ -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();