1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 18:48:03 +01:00

Fix tests

This commit is contained in:
Matthew Brown 2021-08-14 10:45:32 -04:00
parent a4479761a7
commit 6cc5ba970a

View File

@ -316,13 +316,12 @@ class IfAnalyzer
$parent_source = $statements_analyzer->getSource();
$functionlike_storage = $parent_source instanceof \Psalm\Internal\Analyzer\FunctionLikeAnalyzer
? $parent_source->getFunctionLikeStorage()
? $parent_source->getFunctionLikeStorage($statements_analyzer)
: null;
if (!$parent_source instanceof \Psalm\Internal\Analyzer\FunctionLikeAnalyzer
if (!$functionlike_storage
|| (!$parent_source->getSource() instanceof \Psalm\Internal\Analyzer\TraitAnalyzer
&& (!$functionlike_storage
|| !isset($functionlike_storage->param_lookup[substr($var_id, 1)])))
&& !isset($functionlike_storage->param_lookup[substr($var_id, 1)]))
) {
$codebase = $statements_analyzer->getCodebase();
$codebase->analyzer->decrementMixedCount($statements_analyzer->getFilePath());