|
8 | 8 | use Psalm\CodeLocation; |
9 | 9 | use Psalm\Issue\PluginIssue; |
10 | 10 | use Psalm\IssueBuffer; |
11 | | -use Psalm\Plugin\EventHandler\AfterClassLikeAnalysisInterface; |
| 11 | +use Psalm\Plugin\EventHandler\AfterClassLikeVisitInterface; |
12 | 12 | use Psalm\Plugin\EventHandler\AfterFunctionLikeAnalysisInterface; |
13 | | -use Psalm\Plugin\EventHandler\Event\AfterClassLikeAnalysisEvent; |
| 13 | +use Psalm\Plugin\EventHandler\Event\AfterClassLikeVisitEvent; |
14 | 14 | use Psalm\Plugin\EventHandler\Event\AfterFunctionLikeAnalysisEvent; |
15 | 15 | use Psalm\Plugin\PluginEntryPointInterface; |
16 | 16 | use Psalm\Plugin\RegistrationInterface; |
17 | 17 |
|
18 | 18 | /** |
19 | 19 | * @psalm-suppress UnusedClass |
20 | 20 | */ |
21 | | -final class CheckVisibilityPlugin implements PluginEntryPointInterface, AfterClassLikeAnalysisInterface |
| 21 | +final class CheckVisibilityPlugin implements PluginEntryPointInterface, AfterClassLikeVisitInterface |
22 | 22 | { |
23 | | - public static function afterStatementAnalysis(AfterClassLikeAnalysisEvent $event): ?bool |
| 23 | + public static function afterClassLikeVisit(AfterClassLikeVisitEvent $event): void |
24 | 24 | { |
25 | | - $class = $event->getClasslikeStorage(); |
| 25 | + $class = $event->getStorage(); |
26 | 26 |
|
27 | 27 | if ($event->getStmt()->name !== null && !$class->internal && !$class->public_api) { |
28 | | - IssueBuffer::accepts( |
29 | | - new UnspecifiedVisibility( |
30 | | - 'Class ' . $class->name, |
31 | | - $class->location ?? new CodeLocation($event->getStatementsSource(), $event->getStmt()), |
32 | | - ), |
33 | | - $event->getStatementsSource()->getSuppressedIssues(), |
| 28 | + $class->docblock_issues[] = new UnspecifiedVisibility( |
| 29 | + 'Class ' . $class->name, |
| 30 | + $class->location ?? new CodeLocation($event->getStatementsSource(), $event->getStmt()), |
34 | 31 | ); |
35 | 32 | } |
36 | | - |
37 | | - return null; |
38 | 33 | } |
39 | 34 |
|
40 | 35 | public function __invoke(RegistrationInterface $registration, ?\SimpleXMLElement $config = null): void |
|
0 commit comments