Skip to content

Commit

Permalink
FinalClassRule - skip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 29, 2024
1 parent d631120 commit e990321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions build/PHPStan/Build/FinalClassRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPStan\Type\Type;
use function in_array;
use function sprintf;
use function str_starts_with;

/**
* @implements Rule<InClassNode>
Expand Down Expand Up @@ -52,6 +53,10 @@ public function processNode(Node $node, Scope $scope): array
return [];
}

if (str_starts_with($scope->getFile(), dirname(__DIR__, 3) . '/tests')) {
return [];
}

return [
RuleErrorBuilder::message(
sprintf('Class %s must be abstract or final.', $classReflection->getDisplayName()),
Expand Down

0 comments on commit e990321

Please sign in to comment.