mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Only complain about redundant conditions when check_variables is true
This commit is contained in:
parent
6426dbbf0e
commit
6e6ae7aaa6
@ -254,7 +254,12 @@ class IfChecker
|
||||
$changed_var_ids,
|
||||
$cond_referenced_var_ids,
|
||||
$statements_checker,
|
||||
new CodeLocation($statements_checker->getSource(), $stmt->cond, $context->include_location),
|
||||
$context->check_variables
|
||||
? new CodeLocation(
|
||||
$statements_checker->getSource(),
|
||||
$stmt->cond,
|
||||
$context->include_location
|
||||
) : null,
|
||||
$statements_checker->getSuppressedIssues()
|
||||
);
|
||||
|
||||
@ -293,7 +298,12 @@ class IfChecker
|
||||
$changed_var_ids,
|
||||
$stmt->else || $stmt->elseifs ? $cond_referenced_var_ids : [],
|
||||
$statements_checker,
|
||||
new CodeLocation($statements_checker->getSource(), $stmt->cond, $context->include_location),
|
||||
$context->check_variables
|
||||
? new CodeLocation(
|
||||
$statements_checker->getSource(),
|
||||
$stmt->cond,
|
||||
$context->include_location
|
||||
) : null,
|
||||
$statements_checker->getSuppressedIssues()
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user