-
-
Notifications
You must be signed in to change notification settings - Fork 407
[Php74] Add inlinePublic configurable for TypedPropertyRector #1745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
All checks have passed 🎉 @TomasVotruba it is ready for review. |
We're trying to separate PHP declaration rules (https://github.com/rectorphp/rector-src/blob/main/config/set/type-declaration-strict.php) and doblock rules (https://github.com/rectorphp/rector-src/blob/main/config/set/type-declaration.php). It would be better to have this as a separated rule in a docblock rules. Type declarations and docblocks have different priorities and can behave differently. The optional configuration of the rule can be easily overlooked. That's why it should extracted in a separated rule level. E.g. Could you add that one? |
I will try. |
@TomasVotruba as existing
It seems will be duplicated/ambiguous while adding feature for protected and public, it seems we need to create 2 new rules instead:
The After that, remove the what do you think? |
@samsonasik It seems pretty complicated, you're right. Let's take this way then, with explicit option name: $services->set(TypedPropertyRector::class)
->configure([TypedPropertyRector::INLINE_PUBLIC => true]); |
0d37ab6
to
04ec582
Compare
@TomasVotruba ok, implemented with set |
All checks have passed 🎉 @TomasVotruba I think it is ready. |
Looks good, thank you 👍 |
@TomasVotruba this is alternative PR for #1744, which add a new config
isSafeTyped
toTypedPropertyRector
which default to true. If it set to false, with:It will change the following code:
to :
Closes #1744
Closes rectorphp/rector#6872
Closes #1746