1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Allow suppressing UnusedClass on specific classes

This allows suppressing UnusedClass with either `referencedMethod` or
`@psalm-suppress`

Fixes vimeo/psalm#1353
This commit is contained in:
Bruce Weirdan 2019-02-18 16:07:38 +02:00 committed by Matthew Brown
parent 24cdb6e1d3
commit cb453a8da9
2 changed files with 5 additions and 3 deletions

View File

@ -664,8 +664,10 @@ class ClassLikes
if (IssueBuffer::accepts( if (IssueBuffer::accepts(
new UnusedClass( new UnusedClass(
'Class ' . $classlike_storage->name . ' is never used', 'Class ' . $classlike_storage->name . ' is never used',
$classlike_storage->location $classlike_storage->location,
) $classlike_storage->name
),
$classlike_storage->suppressed_issues
)) { )) {
// fall through // fall through
} }

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Psalm\Issue; namespace Psalm\Issue;
class UnusedClass extends CodeIssue class UnusedClass extends ClassIssue
{ {
} }