From 81463c6ba7191b5bb34637b9860384317ffa3274 Mon Sep 17 00:00:00 2001 From: dantleech Date: Sun, 29 Jul 2018 15:58:57 +0100 Subject: [PATCH] Made SymbolInformationFactory a static factory for consistency --- src/DefinitionResolver.php | 10 +--------- src/Factory/SymbolInformationFactory.php | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/DefinitionResolver.php b/src/DefinitionResolver.php index eeb4199..6f2dd38 100644 --- a/src/DefinitionResolver.php +++ b/src/DefinitionResolver.php @@ -43,13 +43,6 @@ class DefinitionResolver */ private $signatureInformationFactory; - /** - * Creates SymbolInformation instances - * - * @var SymbolInformationFactory - */ - private $symbolInformationFactory; - /** * @param ReadableIndex $index */ @@ -59,7 +52,6 @@ class DefinitionResolver $this->typeResolver = new TypeResolver; $this->docBlockFactory = DocBlockFactory::createInstance(); $this->signatureInformationFactory = new SignatureInformationFactory($this); - $this->symbolInformationFactory = new SymbolInformationFactory(); } /** @@ -242,7 +234,7 @@ class DefinitionResolver } } - $def->symbolInformation = $this->symbolInformationFactory->fromNode($node, $fqn); + $def->symbolInformation = SymbolInformationFactory::fromNode($node, $fqn); if ($def->symbolInformation !== null) { $def->type = $this->getTypeFromNode($node); diff --git a/src/Factory/SymbolInformationFactory.php b/src/Factory/SymbolInformationFactory.php index 83bc504..80c2b35 100644 --- a/src/Factory/SymbolInformationFactory.php +++ b/src/Factory/SymbolInformationFactory.php @@ -18,7 +18,7 @@ class SymbolInformationFactory * @param string $fqn If given, $containerName will be extracted from it * @return SymbolInformation|null */ - public function fromNode($node, string $fqn = null):? SymbolInformation + public static function fromNode($node, string $fqn = null):? SymbolInformation { $symbol = new SymbolInformation(); if ($node instanceof Node\Statement\ClassDeclaration) {