Made SymbolInformationFactory a static factory for consistency
parent
6b819abe16
commit
81463c6ba7
|
@ -43,13 +43,6 @@ class DefinitionResolver
|
||||||
*/
|
*/
|
||||||
private $signatureInformationFactory;
|
private $signatureInformationFactory;
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates SymbolInformation instances
|
|
||||||
*
|
|
||||||
* @var SymbolInformationFactory
|
|
||||||
*/
|
|
||||||
private $symbolInformationFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ReadableIndex $index
|
* @param ReadableIndex $index
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +52,6 @@ class DefinitionResolver
|
||||||
$this->typeResolver = new TypeResolver;
|
$this->typeResolver = new TypeResolver;
|
||||||
$this->docBlockFactory = DocBlockFactory::createInstance();
|
$this->docBlockFactory = DocBlockFactory::createInstance();
|
||||||
$this->signatureInformationFactory = new SignatureInformationFactory($this);
|
$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) {
|
if ($def->symbolInformation !== null) {
|
||||||
$def->type = $this->getTypeFromNode($node);
|
$def->type = $this->getTypeFromNode($node);
|
||||||
|
|
|
@ -18,7 +18,7 @@ class SymbolInformationFactory
|
||||||
* @param string $fqn If given, $containerName will be extracted from it
|
* @param string $fqn If given, $containerName will be extracted from it
|
||||||
* @return SymbolInformation|null
|
* @return SymbolInformation|null
|
||||||
*/
|
*/
|
||||||
public function fromNode($node, string $fqn = null):? SymbolInformation
|
public static function fromNode($node, string $fqn = null):? SymbolInformation
|
||||||
{
|
{
|
||||||
$symbol = new SymbolInformation();
|
$symbol = new SymbolInformation();
|
||||||
if ($node instanceof Node\Statement\ClassDeclaration) {
|
if ($node instanceof Node\Statement\ClassDeclaration) {
|
||||||
|
|
Loading…
Reference in New Issue