Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
drupal/coder
now report following error message for core/lib/Drupal/Core/Composer/Composer.php
:
phpcs --standard=Drupal core/lib/Drupal/Core/Composer/Composer.php
FILE: ...ocuments/drupal-8.2.x/core/lib/Drupal/Core/Composer/Composer.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
108 | ERROR | Missing parameter comment
236 | ERROR | dir() is a function name alias, use getdir() instead
----------------------------------------------------------------------
Time: 82ms; Memory: 6Mb
This patch coming with some simple tidy up refer to above report.
Comment | File | Size | Author |
---|---|---|---|
#6 | composer_php_tidy_by_coder-2755741-6.patch | 1.47 KB | mayurjadhav |
Comments
Comment #2
hswong3i CreditAttribution: hswong3i commentedComment #4
hswong3i CreditAttribution: hswong3i commentedComment #6
mayurjadhav CreditAttribution: mayurjadhav at Blisstering Solutions commentedAdded new patch with changes.
Comment #7
hswong3i CreditAttribution: hswong3i commented@mayurjadhav: sorry that can't agree to additional logic changes to this patch, as this issue is just purely for tidy according to drupal/coder report. May you open another issue for handling these changes individually (as I know that core committers usually don't like such merge...)?
(wait, do you means that the CI failed due to the change from dir() to getdir()??)
Comment #8
hswong3i CreditAttribution: hswong3i commented@mayurjadhav sorry after checking with CI console output you are correct, #2060053: file.inc: dir() is a function name alias, use getdir() instead also with some similar fix ;-)
Comment #9
Mile23Just a heads-up that we're doing coding standards by sniff, not by file.
If you add -s to the phpcs command it will tell you the specific sniff in the report, like this:
The parent issue for all the coding standards issues is here: #2571965: [meta] Fix PHP coding standards in core You can search it for issues related to the specific sniffs you're dealing with here. I just added this one #2759789: Fix 'Drupal.Semantics.FunctionAlias' coding standard
There's a meta for the Drupal.Commenting.FunctionComment ones here: #2572645: [Meta] Fix 'Drupal.Commenting.FunctionComment' coding standard It doesn't seem to have one specifically for Drupal.Commenting.FunctionComment.MissingParamComment. I'd wager that one will have a *lot* of errors.
Comment #10
hswong3i CreditAttribution: hswong3i commentedWith #2760467: Improve vendorTestCodeCleanup() with symfony/finder and symfony/filesystem, now we can replace the deleteRecursive() with symfony/filesystem ;-)