1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix a possibly undefined variable seen when issue is suppressed (#391)

This commit is contained in:
Tyson Andre 2017-12-15 09:07:34 -08:00 committed by Matthew Brown
parent 8590b2b9b4
commit e2e86beee7

View File

@ -182,20 +182,19 @@ class DependencyFinderVisitor extends PhpParser\NodeVisitorAbstract implements P
$this->classlike_storages[] = $storage;
if ($doc_comment) {
$docblock_info = null;
try {
$docblock_info = CommentChecker::extractClassLikeDocblockInfo(
(string)$doc_comment,
$doc_comment->getLine()
);
} catch (DocblockParseException $e) {
if (IssueBuffer::accepts(
IssueBuffer::accepts(
new InvalidDocblock(
$e->getMessage() . ' in docblock for ' . implode('.', $this->fq_classlike_names),
new CodeLocation($this->file_checker, $node, null, true)
)
)) {
$docblock_info = null;
}
);
}
if ($docblock_info) {