diff --git a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php index 1c740d63b..0539fb9a1 100644 --- a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php @@ -2439,7 +2439,6 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse $class_template_types = $this->class_template_types; foreach ($docblock_info->params_out as $docblock_param_out) { - $param_name = substr($docblock_param_out['name'], 1); try { @@ -2477,7 +2476,18 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse } foreach ($docblock_info->self_out as $self_out) { - var_dump($self_out); + $out_type = TypeParser::parseTokens( + TypeTokenizer::getFullyQualifiedTokens( + $self_out['type'], + $this->aliases, + $this->function_template_types + $class_template_types, + $this->type_aliases + ), + null, + $this->function_template_types + $class_template_types, + $this->type_aliases + ); + $storage->self_out_type = $out_type; } foreach ($docblock_info->taint_sink_params as $taint_sink_param) { diff --git a/src/Psalm/Storage/MethodStorage.php b/src/Psalm/Storage/MethodStorage.php index 7fd83ada5..3ab2af2ae 100644 --- a/src/Psalm/Storage/MethodStorage.php +++ b/src/Psalm/Storage/MethodStorage.php @@ -72,4 +72,9 @@ class MethodStorage extends FunctionLikeStorage * @var ?string */ public $plain_getter = null; + + /** + * @var Type\Union|null + */ + public $self_out_type = null; }