Repository navigation
Respect @api on class constants and traits, and mark the turbo worker lookup as API - #6791
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ondrejmirtes
requested changes
Oct 23, 2026
| */ | ||
| public const MINIMUM_PHP_VERSION_ID = 80300; | ||
|
|
||
| /** @api */ |
Member
There was a problem hiding this comment.
ApiClassConstFetchRule needs to be improved to actually point out BC-covered and not-covered constants.
Feel free to also improve ApiTraitUseRule. LateResolvableTypeTrait should gain @api, the rule shouldn't report it, but using other traits should.
Contributor
Author
There was a problem hiding this comment.
Done in f9e96a0. The constant rule now accepts @api on the constant or on its declaring class, as the method rules do. The trait rule accepts @api on the trait, and LateResolvableTypeTrait has it now.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ondrejmirtes
approved these changes
Oct 23, 2026
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rector includes phpstan.phar and starts its own workers. To give them the turbo extension, it uses the same
-dflags thatProcessHelperadds. This marks the members it needs as@api:TurboExtensionSelector::findExtensionForWorkers()andEXTENSION_PATH_INI, for the two worker flags.TurboExtensionEnabler::isActive(), for Rector's forked workers.ApiClassConstFetchRulenow also accepts@apion the constant itself or on its declaring class, as the method rules do.ApiTraitUseRuleaccepts@apion the trait, andLateResolvableTypeTraitgets it.phpstan/phpstan#15526 tests the lookup from a program that includes the phar, with and without pcntl.
🤖 Generated with Claude Code