1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fixes #367; Added missing declaration for var_comment variable in ForEachChecker (#368)

This commit is contained in:
Gerrit Addiks 2017-12-04 14:50:59 +01:00 committed by Matthew Brown
parent 8abd77c70f
commit de09bd846c

View File

@ -21,6 +21,7 @@ use Psalm\Issue\RawObjectIteration;
use Psalm\IssueBuffer;
use Psalm\Scope\LoopScope;
use Psalm\Type;
use Psalm\VarDocblockComment;
class ForeachChecker
{
@ -270,6 +271,9 @@ class ForeachChecker
$doc_comment_text = (string)$stmt->getDocComment();
if ($doc_comment_text) {
/** @var VarDocblockComment|null $var_comment */
$var_comment = null;
try {
$var_comment = CommentChecker::getTypeFromComment(
$doc_comment_text,