From 075446e7df2bc6d95f98ee7c2487e1c35e47399d Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Mon, 21 Jan 2019 12:36:17 -0500 Subject: [PATCH] Fix #1223 - MissingClosureParamType should use all known suppressed issues --- .../Analyzer/FunctionLikeAnalyzer.php | 4 +-- tests/IssueSuppressionTest.php | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php index 700969cb2..c17684cca 100644 --- a/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/FunctionLikeAnalyzer.php @@ -564,7 +564,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements 'Parameter $' . $function_param->name . ' has no provided type' . $infer_text, $function_param->location ), - $storage->suppressed_issues + array_merge($this->suppressed_issues, $storage->suppressed_issues) ); } else { IssueBuffer::accepts( @@ -572,7 +572,7 @@ abstract class FunctionLikeAnalyzer extends SourceAnalyzer implements Statements 'Parameter $' . $function_param->name . ' has no provided type' . $infer_text, $function_param->location ), - $storage->suppressed_issues + array_merge($this->suppressed_issues, $storage->suppressed_issues) ); } } diff --git a/tests/IssueSuppressionTest.php b/tests/IssueSuppressionTest.php index 2cbf188b9..31b4117ee 100644 --- a/tests/IssueSuppressionTest.php +++ b/tests/IssueSuppressionTest.php @@ -49,6 +49,36 @@ class IssueSuppressionTest extends TestCase 'assertions' => [], 'error_levels' => ['UndefinedFunction'], ], + 'crossClosureBoundariesOnFunction' => [ + ' [ + '