getDocComment()) && $parsed_docblock = $statements_analyzer->getParsedDocblock()) { $var_comments = []; try { $var_comments = CommentAnalyzer::arrayToDocblocks( $doc_comment, $parsed_docblock, $statements_analyzer->getSource(), $statements_analyzer->getSource()->getAliases(), $statements_analyzer->getSource()->getTemplateTypeMap() ); } catch (DocblockParseException $e) { if (IssueBuffer::accepts( new InvalidDocblock( (string)$e->getMessage(), new CodeLocation($statements_analyzer->getSource(), $stmt, null, true) ) )) { // fall through } } $codebase = $statements_analyzer->getCodebase(); foreach ($var_comments as $var_comment) { if (!$var_comment->var_id || !$var_comment->type) { continue; } $comment_type = \Psalm\Internal\Type\TypeExpander::expandUnion( $codebase, $var_comment->type, $context->self, $context->self, $statements_analyzer->getParentFQCLN() ); $context->vars_in_scope[$var_comment->var_id] = $comment_type; } } } }