Open ostrolucky opened 6 years ago
:+1: though I think I would be better to have a dedicated fixer in the DoctrineAnnotation
namespace.
Already discussed in #3644
Ah thanks for a link. Indeed, it would make sense to fix both cases (phpdoc param/return types and doctrine style classes prefixed with @
).
After looking at it some more, I have realized FullyQualifiedStrictTypesFixer does not do what I want anyway. It changes FCQNs to short versions only if class has been imported. My goal is to import the class if it hasn't been imported.
For all of those who are looking for importing fcqn classes which were not imported, there are
SlevomatCodingStandard\Sniffs\Namespaces\ReferenceUsedNamesOnlySniff which does this For PHP-CS-Fixer, there is Symplify\CodingStandard\Fixer\Import\ImportNamespacedNameFixer
Since this issue has not had any activity within the last 90 days, I have marked it as stale.
The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way.
You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point.
I will close it if no further activity occurs within the next 30 days.
I belive this was fixed by https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/5620
@mvorisek no, #5620 was about phpDoc tags only (@tag \F\Q\C\N
), not annotations (@F\Q\C\N
).
btw, what is this /** @MyClass */
annotation usage?
"attributes defined in phpdoc"
/* @ORM\Column */
for example
I think Doctrine moved to attributes by now, if it's the only use case, maybe there is no big value of creating support for it.
From doctrine/annotations
:
⚠️ PHP 8 introduced attributes, which are a native replacement for annotations. As such, this library is considered feature complete, and should receive exclusively bugfixes and security fixes.
So it has limited support, but is not strictly deprecated. From our perspective it shouldn't be a priority IMHO, but if anyone is willing to contribute, then we can consider merging 😉.
with #7679 this can be easily implemented
Since this issue has not had any activity within the last 90 days, I have marked it as stale.
The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way.
You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point.
I will close it if no further activity occurs within the next 30 days.
Since this issue has not had any activity within the last 90 days, I have marked it as stale.
The purpose of this action is to enforce backlog review once in a while. This is mostly for maintainers and helps with keeping repository in good condition, because stale issues and PRs can accumulate over time and make it harder for others to find relevant information. It is also possible that some changes has been made to the repo already, and issue or PR became outdated, but wasn't closed for some reason. This action helps with periodic review and closing of such stale items in automated way.
You may let maintainers handle this or verify current relevancy by yourself, to help with re-triage. Any activity will remove stale label so it won't be automatically closed at this point.
I will close it if no further activity occurs within the next 30 days.
I would like to apply this fixer across annotations as well. Here's what I expect to fix
into
How do you think solution should look like? As far as I see, so far no fixer outside DoctrineAnnotation fixes annotations