Problem/Motivation

Adding the GitLab CI template identified some coding standards issues:

FILE: ...rssb-3442148/web/modules/custom/rrssb-3442148/src/Form/RRSSBDeleteForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Form\FormStateInterface.
   |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: /builds/issue/rrssb-3442148/web/modules/custom/rrssb-3442148/rrssb.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  18 | ERROR   | [x] Use statements should be sorted alphabetically. The first
     |         |     wrong one is Drupal\Core\Render\BubbleableMetadata.
     |         |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
  43 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
     |         |     (Drupal.Files.LineLength.TooLong)
 189 | WARNING | [ ] Line exceeds 80 characters; contains 90 characters
     |         |     (Drupal.Files.LineLength.TooLong)
 368 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
     |         |     (Drupal.Files.LineLength.TooLong)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: /builds/issue/rrssb-3442148/web/modules/custom/rrssb-3442148/rrssb.install
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 10 | ERROR | [x] Use statements should be sorted alphabetically. The first
    |       |     wrong one is Drupal\Core\Config\Entity\ConfigEntityType.
    |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)

Let's fix these.

Issue fork rrssb-3446292

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Status: Active » Needs review
paraderojether’s picture

Hi

I reviewed MR!12, applied against Ridiculously Responsive Social Sharing Buttons 8.x-2.x-dev and there are still phpcs issues shown below:

jetherparadero@PrometSources-MacBook-Pro-3 contrib % phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig rrssb

FILE: /Users/jetherparadero/d_o/drupal-issues/web/modules/contrib/rrssb/rrssb.module
-------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------
 20 | WARNING | Global constants should not be used, move it to a class or interface
-------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/d_o/drupal-issues/web/modules/contrib/rrssb/src/Form/RRSSBSettingsForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  79 | WARNING | Variable $require_follow inside unset call is undefined.
 186 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 189 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/jetherparadero/d_o/drupal-issues/web/modules/contrib/rrssb/src/Plugin/Block/RRSSBBlock.php
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
 27 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
-------------------------------------------------------------------------------------------------------

Time: 310ms; Memory: 12MB

Kindly check and advise, please.
Thank you.

ptmkenny’s picture

@paraderojether Please note that this issue is to fix the coding standards issues identified by GitLab CI, which you can see are fixed in the pipeline here: https://git.drupalcode.org/issue/rrssb-3446292/-/jobs/1557122

The GitLab CI tests will report DI issues like

 27 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead

as phpstan issues, not coding standards issues. I guess this is to ensure that issues don't get fixed twice (no duplication of work).

You can see that the DI issues are fixed in the phpstan issue: https://www.drupal.org/project/rrssb/issues/3446295

AdamPS made their first commit to this issue’s fork.

adamps’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.