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); $this->collectDefinitionsAndReferences($node);
} }
public function getDiagnostics() /**
* @return Diagnostic[]
*/
public function getDiagnostics(): array
{ {
return $this->diagnostics ?? []; return $this->diagnostics ?? [];
} }
/**
* @return void
*/
private function addReference(string $fqn, Node $node) private function addReference(string $fqn, Node $node)
{ {
if (!isset($this->referenceNodes[$fqn])) { if (!isset($this->referenceNodes[$fqn])) {
@ -169,21 +175,33 @@ class TreeAnalyzer
$this->referenceNodes[$fqn][] = $node; $this->referenceNodes[$fqn][] = $node;
} }
/**
* @return Definition
*/
public function getDefinitions() public function getDefinitions()
{ {
return $this->definitions ?? []; return $this->definitions ?? [];
} }
/**
* @return Node[]
*/
public function getDefinitionNodes() public function getDefinitionNodes()
{ {
return $this->definitionNodes ?? []; return $this->definitionNodes ?? [];
} }
/**
* @return Node[]
*/
public function getReferenceNodes() public function getReferenceNodes()
{ {
return $this->referenceNodes ?? []; return $this->referenceNodes ?? [];
} }
/**
* @return Node[]
*/
public function getStmts() public function getStmts()
{ {
return $this->stmts; return $this->stmts;

View File

@ -68,7 +68,7 @@ class DefinitionCollectorTest extends TestCase
/** /**
* @param $path * @param $path
*/ */
private function collectDefinitions($path): array private function collectDefinitions(string $path): array
{ {
$uri = pathToUri($path); $uri = pathToUri($path);
$parser = new PhpParser\Parser(); $parser = new PhpParser\Parser();