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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hswong3i created an issue. See original summary.

hswong3i’s picture

Status: Needs review » Needs work

The last submitted patch, 2: drupal-8.2.x-composer_php_tidy_by_coder-2755741-2.patch, failed testing.

hswong3i’s picture

The last submitted patch, 2: drupal-8.2.x-composer_php_tidy_by_coder-2755741-2.patch, failed testing.

mayurjadhav’s picture

Status: Needs work » Needs review
FileSize
1.47 KB

Added new patch with changes.

hswong3i’s picture

@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()??)

hswong3i’s picture

@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 ;-)

Mile23’s picture

Just 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:

$ ./vendor/bin/phpcs -p -s --standard=Drupal core/lib/Drupal/Core/Composer/Composer.php 
E


FILE: ...chum/projects/drupal8/core/lib/Drupal/Core/Composer/Composer.php
----------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
----------------------------------------------------------------------
 108 | ERROR | Missing parameter comment
     |       | (Drupal.Commenting.FunctionComment.MissingParamComment)
 236 | ERROR | dir() is a function name alias, use getdir() instead
     |       | (Drupal.Semantics.FunctionAlias.FunctionAlias)
----------------------------------------------------------------------

Time: 258ms; Memory: 4.75Mb

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.

hswong3i’s picture

Status: Needs review » Closed (outdated)
Issue tags: +Composer

With #2760467: Improve vendorTestCodeCleanup() with symfony/finder and symfony/filesystem, now we can replace the deleteRecursive() with symfony/filesystem ;-)