From 5b0e8bd1bea0485c88cd8be1c865e39415f351c8 Mon Sep 17 00:00:00 2001 From: Matt Brown Date: Fri, 27 Nov 2020 17:16:55 -0500 Subject: [PATCH] =?UTF-8?q?Only=20show=20possibly=20unused=20params=20on?= =?UTF-8?q?=20methods=20that=20don=E2=80=99t=20extend=20others?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- psalm.xml.dist | 3 --- src/Psalm/Internal/Codebase/ClassLikes.php | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index 5c32350bc..a7d5fd4ac 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -67,9 +67,6 @@ - - - diff --git a/src/Psalm/Internal/Codebase/ClassLikes.php b/src/Psalm/Internal/Codebase/ClassLikes.php index 65711a33c..1cc52f76e 100644 --- a/src/Psalm/Internal/Codebase/ClassLikes.php +++ b/src/Psalm/Internal/Codebase/ClassLikes.php @@ -1706,12 +1706,13 @@ class ClassLikes && !$classlike_storage->is_interface ) { foreach ($method_storage->params as $offset => $param_storage) { - if (!$this->file_reference_provider->isMethodParamUsed( - strtolower((string) $method_id), - $offset - ) + if (empty($classlike_storage->overridden_method_ids[$method_name]) && $param_storage->location && !$param_storage->promoted_property + && !$this->file_reference_provider->isMethodParamUsed( + strtolower((string) $method_id), + $offset + ) ) { if ($method_storage->final) { if (IssueBuffer::accepts(