From 9c2552b7e744926d1a74c1ba8fd32c64079eed61 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Thu, 9 Mar 2023 17:05:37 +0100 Subject: [PATCH] Bleeding edge - InvalidPHPStanDocTagRule in StubValidator --- src/PhpDoc/StubValidator.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/PhpDoc/StubValidator.php b/src/PhpDoc/StubValidator.php index 3f1d9804bb..27582a614c 100644 --- a/src/PhpDoc/StubValidator.php +++ b/src/PhpDoc/StubValidator.php @@ -50,6 +50,7 @@ use PHPStan\Rules\PhpDoc\IncompatiblePhpDocTypeRule; use PHPStan\Rules\PhpDoc\IncompatiblePropertyPhpDocTypeRule; use PHPStan\Rules\PhpDoc\InvalidPhpDocTagValueRule; +use PHPStan\Rules\PhpDoc\InvalidPHPStanDocTagRule; use PHPStan\Rules\PhpDoc\InvalidThrowsPhpDocValueRule; use PHPStan\Rules\PhpDoc\UnresolvableTypeHelper; use PHPStan\Rules\Properties\ExistingClassesInPropertiesRule; @@ -197,6 +198,14 @@ private function getRuleRegistry(Container $container): RuleRegistry $rules[] = new DuplicateFunctionDeclarationRule($reflector, $relativePathHelper); } + if ((bool) $container->getParameter('featureToggles')['allInvalidPhpDocs']) { + $rules[] = new InvalidPHPStanDocTagRule( + $container->getByType(Lexer::class), + $container->getByType(PhpDocParser::class), + true, + ); + } + return new DirectRuleRegistry($rules); }