Skip to content

Commit

Permalink
Bleeding edge - InvalidPHPStanDocTagRule in StubValidator
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Mar 9, 2023
1 parent 9780d35 commit 9c2552b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/PhpDoc/StubValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 9c2552b

Please sign in to comment.