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

Allow loop breaks to take precedence over case breaks

This commit is contained in:
Matthew Brown 2018-11-10 17:29:59 -05:00
parent aa426aca03
commit c136974f4d
4 changed files with 5 additions and 0 deletions

View File

@ -24,6 +24,8 @@ class DoChecker
) {
$do_context = clone $context;
$do_context->inside_case = false;
$project_checker = $statements_checker->getFileChecker()->project_checker;
if ($project_checker->alter_code) {

View File

@ -50,6 +50,7 @@ class ForChecker
$for_context = clone $context;
$for_context->inside_loop = true;
$for_context->inside_case = false;
$project_checker = $statements_checker->getFileChecker()->project_checker;

View File

@ -369,6 +369,7 @@ class ForeachChecker
$foreach_context = clone $context;
$foreach_context->inside_loop = true;
$foreach_context->inside_case = false;
if ($project_checker->alter_code) {
$foreach_context->branch_point =

View File

@ -34,6 +34,7 @@ class WhileChecker
$while_context = clone $context;
$while_context->inside_loop = true;
$while_context->inside_case = false;
$project_checker = $statements_checker->getFileChecker()->project_checker;