Fixes coding standards issues

Created on 6 November 2024, 2 months ago

phpcs reports some coding standars issues. We shoudl fix them.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France nicolasgraph Strasbourg

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @nicolasgraph
  • Merge request !5Fixes-coding-standards → (Merged) created by nicolasgraph
  • 🇮🇳India chandansha

    I have tested MR 5. There is still some of error pending.

    FILE: /home/chandansha/docker/d10contro/web/modules/custom/guest_suite-3485846/src/Form/SettingsForm.php
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------------------------------
      83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     157 | ERROR   | Missing parameter comment
    ------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/chandansha/docker/d10contro/web/modules/custom/guest_suite-3485846/src/Cron.php
    ---------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------
     48 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    ---------------------------------------------------------------------------------------------
    
    Time: 396ms; Memory: 12MB
    

    Thanks!!

  • 🇫🇷France nicolasgraph Strasbourg

    The \Drupal call in the Cron class is documented as required. Tests are needed before to correct it.

  • 🇫🇷France nicolasgraph Strasbourg

    \Drupal call removed, local tests succeeded.

  • Result of the last test

    FILE: ...pp/web/modules/contrib/guest_suite/src/Form/ManualImportForm.php
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     130 | ERROR | The array declaration extends to column 83 (the limit
         |       | is 80). The array content should be split up over
         |       | multiple lines
    ----------------------------------------------------------------------
    
    
    FILE: /app/web/modules/contrib/guest_suite/PATCHES.txt
    ----------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    ----------------------------------------------------------------------
     1 | WARNING | [ ] Line exceeds 80 characters; contains 104
       |         |     characters
     5 | ERROR   | [x] Expected 1 newline at end of file; 3 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    Time: 517ms; Memory: 12MB
  • Please excuse me, the result of this test is incorrect. However, it is possible that the error 'Unsafe usage of new static' may appear, which is why I am proposing a configuration with phpstan.neon.

  • Pipeline finished with Skipped
    about 1 month ago
    #356480
  • 🇫🇷France nicolasgraph Strasbourg

    Thank you all!

Production build 0.71.5 2024