-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ReturnAssignmentFixer needs to also remove inline docblock for the variable it's removing #3858
Comments
Thanks for the report, it was briefly discussed on gitter. |
As the mentioned PR got closed without resolving anything, can this issue be reopened? |
So what is the plan? I cannot see what else could we do other than removing all non-meaningful tokens between the removed assignment and @keradus did you said "comment shall be removed" in this particular case? |
I think it is best to have a fixer that changes invalid PHPDocs into comments. If that means that in some cases a human must check the comments because we cannot process free text, than that is fine by me :) |
That fixer exists ( Upon finding the issue, I went on gitter, explained the situation, and got answered by @keradus. And that's why the opening lines of this issue say:
The simplest solution could be along the lines of (pseudo-code incoming):
Which should then run before I would also be fine with just the priority change, but that's not what @keradus told me to go for. |
Me too. The problem is |
Kindly note that I think @keradus and I have different opinions on this topic. |
I didn't read the whole discussion but I disagree with the title. With docblock types that include generics the docblock might be a necessity for PHPStan or Psalm to not report type mismatch errors. Therefore rather than removing the docblock as well I think a variable with a docblock should NOT be removed by this fixer. |
Hi @enumag , I think you request another feature than in the original report indeed.
|
I see. Should I create a separate issue then? |
I would recommend that :) |
I'm going to close this because issue mentions Fixer version which is not maintained anymore. Feel free to reproduce it on latest version (if problem still exists) and create new issue. |
I was unsure whether to report this as priority issue where
return_assignment
needs to run beforephpdoc_to_comment
or if it's the responsibility ofReturnAssignmentFixer
.The PHP version you are using (
$ php -v
):PHP CS Fixer version you are using (
$ php-cs-fixer -V
):PHP CS Fixer 2.12.1 Long Journey by Fabien Potencier and Dariusz Ruminski
The command you use to run PHP CS Fixer:
vendor/bin/php-cs-fixer fix -v --using-cache=no
The configuration file you are using, if any:
Basically the same as dmvdbrugge/dynamic-components, except
explicit_string_variable
,header_comment
,no_alternative_syntax
, andno_unset_on_property
If applicable, please provide minimum samples of PHP code (as plain text, not screenshots):
Either immediately arrive at the last step, or docblock should've been removed.
Meta: this is case 14 of #3844
The text was updated successfully, but these errors were encountered: