Max Type Coverage Level using withTypeCoverageLevel method #8984
Answered
by
TomasVotruba
vinceAmstoutz
asked this question in
Q&A
|
What is the maximum value of the level parameter of |
Answered by
TomasVotruba
Jan 27, 2025
Replies: 3 comments 8 replies
|
You can use PHP_INT_MAX i guess :) |
0 replies
|
Levels are temporary approach to get your project in shape gradually, without much pressure . |
8 replies
|
This will help with to understand too high level :) rectorphp/rector-src#6735 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This might help: https://getrector.com/documentation/levels#content-one-level-at-a-time
1 level = 1 rule. Depending on codebase size and complexity, you can jump 1 or 5 or 10 steps at a time. We do 1 level/rule at at time, because legacy projects we work with are really huge.
If you clik on
withTypeCoverageLevel()method, the IDE will lead you toTypeDeclarationLevel::RULESwhere all the rules are listed: https://github.com/rectorphp/rector-src/blob/abaf47c828502d09a968590292aafe71d34e3e17/src/Config/Level/TypeDeclarationLevel.php#L66-L136Right now there is ~70-80 rules, so max level is the same number.
That's the whole magic :)