-
-
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
fully_qualified_strict_types
breaks @see tag
#7620
Comments
I was just about to report this, @Wirone let's revert #5620, the fixing must be done on TypeExpression parsed phpdoc, see #7619 issue for it (which should be then converted to feature request probably). In our case, the /**
- * @see http://editor.datatables.net
+ * @see http://editor.datatables.net
*/
define('DATATABLES', true); |
What's actually breaking here? If the fixer shortened FQCN it means it was already imported in your class, so it should work anyway. Is navigating in the IDE not working? |
see my updated post above, the fixer does now crazy things as applied on |
https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#513-see
|
also see is often like |
The Rector rule AddSeeTestAnnotationRector intentionally uses FQCN. 1) system/Commands/Database/MigrateStatus.php:18
---------- begin diff ----------
@@ @@
* Displays a list of all migrations and whether they've been run or not.
*
* @see MigrateStatusTest
+ * @see \CodeIgniter\Commands\Database\MigrateStatusTest
*/
class MigrateStatus extends BaseCommand
{
----------- end diff -----------
Applied rules:
* AddSeeTestAnnotationRector |
First of all, phpDoc is modified only if the short symbol is matched, so it shouldn't touch Anyway, I won't be able to work on it today, family time for me. |
@kenjis thanks for the info. IMHO if short version in the annotation works as expected then maybe it's a bug in Rector, which should not add another |
here is the full source: https://github.com/DataTables/Editor-PHP/blob/4447b5996615bf25e0fc189cde3449fc578c755e/DataTables.php#L11 fixer output:
it seems like the fixer tries to trim the phpdoc even if otherwise unchanged, also, it seems it does so only in this one file, and not in others with the same |
In #7622 I've provided some basic improvements for how FQCNs are handled in phpDoc, so it won't touch non-FQCNs anymore and it won't change whitespace between the tag and the value. These are clear bugs that should be fixed. Config option for enabling/disabling phpDoc support is not that urgent IMHO, I will try to provide it but later. |
@Wirone Thank you for your comments. In terms of class names, the short name is also correct. However, that Rector rule uses FQCN because it does not import ( |
@kenjis Rector also have an option for importing names. On the other hand, Fixer imports symbols only if the config option is enabled - did you do it? Because it wasn't included in any rule set yet. |
We are using |
@kenjis so it's Rector who imports names, and then Fixer (which you probably run after Rector, as suggested) only shortens already imported names 😉. |
My explanation was not correct. Adding the same class annotation may be a bug in Rector, but I don't expect it to be fixed anytime soon. |
Ah, that's the reason why it is shortened 👍. I've created #7628 which provides ability to configure |
Bug report
Description
fully_qualified_strict_types
breaks @see tag by AddSeeTestAnnotationRectorhttps://github.com/rectorphp/rector-phpunit/blob/main/docs/rector_rules_overview.md#addseetestannotationrector
See also https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#513-see
Runtime version
PHP CS Fixer 3.42.0 Three Keys by Fabien Potencier and Dariusz Ruminski.
PHP runtime: 8.2.13
Used command
php-cs-fixer fix --ansi --verbose --diff
Configuration file
Code snippet that reproduces the problem
The text was updated successfully, but these errors were encountered: