Fix the issues reported by phpcs

Created on 23 March 2023, over 1 year ago
Updated 21 June 2024, 7 days ago

Running phpcs --standard="Drupal,DrupalPractice" --extensions=php,module,inc,install,test,profile,theme,css,info,yml,md --report-width=79 reports the following errors/warnings which should be fixed.

FILE: ./log_stdout/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 3 | WARNING | Line exceeds 80 characters; contains 111 characters
----------------------------------------------------------------------


FILE: ./log_stdout/log_stdout.links.menu.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
 6 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------


FILE: ./log_stdout/src/Logger/Stdout.php
-------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is Drupal\Core\Logger\RfcLogLevel.
-------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------

Time: 201ms; Memory: 10MB

 
 

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India gayatri chahar

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 @gayatri chahar
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India gayatri chahar

    Patch created. Please review it

    Thanks

  • Assigned to hardikpandya
  • Status changed to Needs work over 1 year ago
  • 🇮🇳India hardikpandya

    This would be part of phpcs fixes and a single ticket should be created to fix all phpcs issues rather than breaking it up. Updating the details and tags for this issue.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇳India dineshkumarbollu

    Hi

    MR!4 found some issues.

    vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig web/modules/contrib/log_google_chat-3340484/

    FILE: /var/www/html/drupalvb/web/modules/contrib/log_google_chat-3340484/src/Logger/GoogleChatLogMessageFormatter.php
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 6 ERRORS AND 2 WARNINGS AFFECTING 8 LINES
    ---------------------------------------------------------------------------------------------------------------------------
    58 | ERROR | Doc comment is empty
    61 | ERROR | Public method name "GoogleChatLogMessageFormatter::send_to_google_chat" is not in lowerCamel format
    76 | WARNING | Unused variable $result.
    81 | ERROR | Doc comment is empty
    84 | ERROR | Public method name "GoogleChatLogMessageFormatter::format_message_with_theme" is not in lowerCamel format
    92 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
    105 | ERROR | Doc comment is empty
    108 | ERROR | Public method name "GoogleChatLogMessageFormatter::is_content_allowed" is not in lowerCamel format
    ---------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/drupalvb/web/modules/contrib/log_google_chat-3340484/log_google_chat.module
    ------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------------
    20 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
    41 | WARNING | Unused global variable $base_root.
    42 | WARNING | Unused variable $config.
    ------------------------------------------------------------------------------------------------------

    Time: 327ms; Memory: 12MB

    Thanks.

  • Status changed to Needs work over 1 year ago
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India hardikpandya

    Added core_version_requirement in the info file. The README file normally can have more than 80 characters and that warning could be ignored.

  • Status changed to Needs work 18 days ago
  • 🇮🇳India dev16.addweb

    Need to fix below remaining phpcs issue

    modules/custom/log_stdout/
    
    FILE: /home/addweb/Drupal8-vagrant/web/web/contribution/drupal-9-3/web/modules/custom/log_stdout/src/Logger/Stdout.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Logger\RfcLogLevel.
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/addweb/Drupal8-vagrant/web/web/contribution/drupal-9-3/web/modules/custom/log_stdout/README.md
    -----------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------
     3 | WARNING | Line exceeds 80 characters; contains 111 characters
    -----------------------------------------------------------------------------------------------------------
    
    Time: 91ms; Memory: 10MB
  • Status changed to Needs review 18 days ago
  • 🇮🇳India dev16.addweb

    I have Fixed issues mention on #11, Please review.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The 8.x-2.x branch is not supported, and it has not been updated since September 3, 2020, contrary to the 8.x-1.x branch which has been updated eight months ago.

  • 🇮🇳India dev16.addweb

    Hi @apaderno, Should we check and create a new merge request against the 8.x-1.x branch?

  • Pipeline finished with Failed
    7 days ago
    Total: 40s
    #204679
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    apaderno changed the visibility of the branch 3349806-fix-phpcs-warnings-errors to hidden.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    apaderno changed the visibility of the branch 3349806-fix-php_codesniffer-warnings_errors to hidden.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    apaderno changed the visibility of the branch 3349806-fix-php_codesniffer-warnings_errors to active.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    (Let's include the .md files.)

Production build 0.69.0 2024