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

Only show possibly unused params on methods that don’t extend others

This commit is contained in:
Matt Brown 2020-11-27 17:16:55 -05:00 committed by Daniil Gentili
parent 0df867cdff
commit 5b0e8bd1be
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 5 additions and 7 deletions

View File

@ -67,9 +67,6 @@
<errorLevel type="suppress">
<directory name="examples"/>
</errorLevel>
<errorLevel type="info">
<directory name="src/Psalm/Type/Atomic"/>
</errorLevel>
</PossiblyUnusedParam>
<UnusedClass>

View File

@ -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(