1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00

Pass in the right context

This commit is contained in:
Matthew Brown 2016-08-24 00:22:38 -04:00
parent 212edcd16b
commit 0e68179bb4
2 changed files with 4 additions and 4 deletions

View File

@ -1686,7 +1686,7 @@ class StatementsChecker
}
}
$this->check($stmt->stmts, $for_context, $for_context);
$this->check($stmt->stmts, $for_context, $context);
foreach ($context->vars_in_scope as $var => $type) {
if ($type->isMixed()) {
@ -1807,7 +1807,7 @@ class StatementsChecker
CommentChecker::getTypeFromComment((string) $stmt->getDocComment(), $foreach_context, $this->source, null);
$this->check($stmt->stmts, $foreach_context, $foreach_context);
$this->check($stmt->stmts, $foreach_context, $context);
foreach ($context->vars_in_scope as $var => $type) {
if ($type->isMixed()) {
@ -1856,7 +1856,7 @@ class StatementsChecker
$while_context->vars_in_scope = $while_vars_in_scope_reconciled;
}
if ($this->check($stmt->stmts, $while_context, $while_context) === false) {
if ($this->check($stmt->stmts, $while_context, $context) === false) {
return false;
}

View File

@ -31,7 +31,7 @@ class Config
* Whether or not to use types as defined in docblocks
* @var boolean
*/
public $use_docblock_types = false;
public $use_docblock_types = true;
/**
* Whether or not to throw an exception on first error