Rename TypeFactory::buildTypeFromFqcn() => buildTypeFromString()

parent 864b98ee
......@@ -147,16 +147,16 @@ final class TypeFactory
return new Type('null');
}
public function buildTypeFromFqcn(string $fqcn): Type
public function buildTypeFromString(string $string): Type
{
if ($fqcn === 'self' || $fqcn === 'this') {
throw new UnknownFqcnException("Can't create the type simply from the '$fqcn' FQCN");
if ($string === 'self' || $string === 'this') {
throw new UnknownFqcnException("Can't create the type from '$string'.");
}
try {
return new Type($fqcn, $this->nodeCollection->getAstNode($fqcn));
return new Type($string, $this->nodeCollection->getAstNode($string));
} catch (AstNodeNotFoundException $e) {
return new Type($fqcn);
return new Type($string);
}
}
......
......@@ -498,6 +498,6 @@ final class TypeResolverInjectorVisitor extends NodeVisitorAbstract
$namespaceNode = ParentConnectorVisitor::getFirstParentNodeOfType($property, Namespace_::class);
$namespacedType = $namespaceNode->name . "\\$type";
return $this->typeFactory->buildTypeFromFqcn($namespacedType);
return $this->typeFactory->buildTypeFromString($namespacedType);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment