Skip to content

Add support for reading inheritors from a phpstan-sealed tag#11818

Open
stof wants to merge 1 commit intovimeo:6.xfrom
stof:phpstan_sealed
Open

Add support for reading inheritors from a phpstan-sealed tag#11818
stof wants to merge 1 commit intovimeo:6.xfrom
stof:phpstan_sealed

Conversation

@stof
Copy link
Copy Markdown
Contributor

@stof stof commented Apr 21, 2026

This improves interoperability for vendor libraries that are using phpstan. The @phpstan-sealed tag has the same semantic than @psalm-inheritors.

Closes #11510


Note

Medium Risk
Updates docblock parsing to alias @phpstan-sealed into the inheritors constraint logic, which can change class/interface inheritance validation outcomes for existing codebases.

Overview
Adds interoperability with PHPStan’s @phpstan-sealed by mapping it to Psalm’s @psalm-inheritors during docblock parsing (via combined_tags).

Updates ClassLikeDocblockParser to read inheritors only from combined_tags, and extends the test suite to assert that extending a @phpstan-sealed base class triggers InheritorViolation the same way @psalm-inheritors does.

Reviewed by Cursor Bugbot for commit fd4ae22. Bugbot is set up for automated code reviews on this repo. Configure here.

This improves interoperability for vendor libraries that are using
phpstan. The `@phpstan-sealed` tag has the same semantic than
`@psalm-inheritors`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support converting @phpstan-sealed to @psalm-inheritors

1 participant