Fix the issues reported by phpcs

Created on 28 March 2024, 9 months ago
Updated 11 June 2024, 7 months ago

Problem/Motivation

Here is the command to fix phpcs issue:-
vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,css,theme,info,txt,md,yml modules/contrib/llom/

FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/src/Form/LlomAdminForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------------------------------------------------------------------------
  45 | WARNING | Menu::loadMultiple calls should be avoided in classes, use dependency injection instead
  62 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
  95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
  95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 105 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 112 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 113 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 118 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 146 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/src/Plugin/Menu/LlomMenuLink.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
 207 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/src/Plugin/Menu/LlomMenuSwitchLink.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 14 WARNINGS AFFECTING 14 LINES
----------------------------------------------------------------------
  6 | WARNING | Line exceeds 80 characters; contains 182 characters
  8 | WARNING | Line exceeds 80 characters; contains 293 characters
 13 | WARNING | Line exceeds 80 characters; contains 134 characters
 17 | WARNING | Line exceeds 80 characters; contains 195 characters
 19 | WARNING | Line exceeds 80 characters; contains 110 characters
 21 | WARNING | Line exceeds 80 characters; contains 137 characters
 22 | WARNING | Line exceeds 80 characters; contains 87 characters
 23 | WARNING | Line exceeds 80 characters; contains 85 characters
 24 | WARNING | Line exceeds 80 characters; contains 150 characters
 26 | WARNING | Line exceeds 80 characters; contains 135 characters
 28 | WARNING | Line exceeds 80 characters; contains 121 characters
 33 | WARNING | Line exceeds 80 characters; contains 383 characters
 35 | WARNING | Line exceeds 80 characters; contains 174 characters
 37 | WARNING | Line exceeds 80 characters; contains 99 characters
----------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/llom.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/llom.module
----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
 65 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/drupal-contri-d10/modules/contrib/llom/llom.routing.yml
---------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 3 found
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

Time: 281ms; Memory: 10MB

Steps to reproduce

Run PHPCS on Language Links On Menu module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India bhaveshdas

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bhaveshdas
  • Merge request !1fix the phpcs issuse → (Merged) created by bhaveshdas
  • 🇮🇳India bhaveshdas

    hello,

    I solve all issue. But still there are some issues left.
    Please have a look.

    Thankyou !

    FILE: /var/www/html/drupal-contri-d10/modules/custom/llom-3436718/src/Form/LlomAdminForm.php
    ---------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
    ---------------------------------------------------------------------------------------------------------
      45 | WARNING | Menu::loadMultiple calls should be avoided in classes, use dependency injection instead
      62 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
      91 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     105 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
     146 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------------------
    
    Time: 209ms; Memory: 10MB
    
  • Assigned to akshaydalvi212
  • 🇮🇳India akshaydalvi212

    I will work on this issue.

  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • 🇮🇳India akshaydalvi212

    Fix the remaining Dependency injection issues.
    kindly review.

  • 🇮🇹Italy stecalle

    Hi guys.

    Thanks for yours quickly fixes.

    Sorry, I'm new of github and its methods. If I understood:

    1. I accept the MR above (I saw the diff)
    2. then I need to pull to me
    3. review all
    4. thus push again with a new tag

    Correct?

    Thanks again

    Stefano

  • Status changed to Fixed 9 months ago
  • 🇮🇹Italy stecalle

    Hi,
    after merged the code, I made some fixes due to errors in the new code.

    Now phpcs pass the test, so I close the issue.

    Thanks at all.

    Stefano

  • Status changed to Fixed 9 months ago
Production build 0.71.5 2024