-
Notifications
You must be signed in to change notification settings - Fork 93
[Symfony53] Add CommandDescriptionToPropertyRector #245
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
Thanks 👍 What Symfony version support the name and the description? |
I think from 5.3 they support this: https://symfony.com/doc/5.3/console.html (but that is not maintained) so i would say 5.4/6.0 and 6.1 The blog post you probably found: https://symfony.com/blog/new-in-symfony-5-3-lazy-command-description What do you mean by
Should i use different configs to test this behavior? And is there some docs about that? |
Symfony 5.3 is for the The
The docs can be found here: https://github.com/rectorphp/rector/tree/main/docs But there is no description rule yet, AFAIK. So the new rule and tests are needed. |
Ah like that i can do that but takes a bit more time |
final class SunshineCommand extends Command | ||
{ | ||
protected static $defaultName = 'sunshine'; | ||
protected static $defaultDescription = 'sunshine description'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to force this order? Right now its adding the defaultDescription as first property.
So first $defaultName
and then $defaultDescription
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd have to look for existing properties on the Class_
and if there's a property of "defaultName", add a new property after it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added function addDefaultDescriptionProperty
to do it, you may resolve this if it is okay
You can run:
To make CI green. |
Thanks @samsonasik i did and squashed my commits into 1 commit. |
String_ and ClassConstFetch check no longer needed, can be removed as already checked by ExprAnalyzer. Also, please update PR Title to something like:
|
Add a rule to move command description setter to property
Check, thanks for the feedback 👍 |
Thank you 👏 |
See #229