diff --git a/src/Index/Index.php b/src/Index/Index.php index 7a13529..9cb975e 100644 --- a/src/Index/Index.php +++ b/src/Index/Index.php @@ -26,7 +26,7 @@ class Index implements ReadableIndex, \Serializable * * @var string[][] */ - public $references = []; + private $references = []; /** * @var bool @@ -150,6 +150,17 @@ class Index implements ReadableIndex, \Serializable return $this->references[$fqn] ?? []; } + /** + * For test use. + * Returns all references, keyed by fqn. + * + * @return string[][] + */ + public function getReferences(): array + { + return $this->references; + } + /** * Adds a document URI as a referencee of a specific symbol * diff --git a/tests/Validation/ValidationTest.php b/tests/Validation/ValidationTest.php index 7957fc1..1145df0 100644 --- a/tests/Validation/ValidationTest.php +++ b/tests/Validation/ValidationTest.php @@ -103,7 +103,7 @@ class ValidationTest extends TestCase $document = new PhpDocument($filename, $fileContents, $index, $parser, $docBlockFactory, $definitionResolver); - $actualRefs = $index->references; + $actualRefs = $index->getReferences(); $this->filterSkippedReferences($actualRefs); $actualDefs = $this->getTestValuesFromDefs($document->getDefinitions());