Drupal Coding Standards Issues | phpcs

Created on 20 January 2023, almost 2 years ago
Updated 30 July 2024, 4 months ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal ad_entity_adition

FILE: C:\Users\Admin\Desktop\task\ad_entity_adition\js\adition.js
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
  6 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 42 | ERROR | [x] Expected 1 space after "?"; 0 found
 42 | ERROR | [x] Expected 1 space before "?"; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: C:\Users\Admin\Desktop\task\ad_entity_adition\js\adition_default_view.js
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found
     |       |     "\r\n"
   9 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  14 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  32 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  44 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  68 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  78 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  83 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
  94 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 111 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
 135 | ERROR | [x] Expected 1 space after FUNCTION keyword; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...Desktop\task\ad_entity_adition\src\Plugin\ad_entity\AdType\AditionType.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...Desktop\task\ad_entity_adition\src\Plugin\ad_entity\AdView\AditionView.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 441ms; Memory: 10MB

Proposed resolution

Fix the errors and warnings.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India jay jangid Jaipur

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Needs work 5 months ago
  • 🇮🇳India riddhi.addweb

    I tried to apply the Patch in the 9.5x version but after applying the patch, it still throws the error. Seems like the error is still not resolved.

    FILE: /var/www/html/web/Drupal_9.5/web/modules/contrib/ad_entity_adition/src/Plugin/ad_entity/AdType/AditionType.php
    --------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------
     8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Config\Config.
    --------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/Drupal_9.5/web/modules/contrib/ad_entity_adition/src/Plugin/ad_entity/AdView/AditionView.php
    -----------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------------------
     6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\ad_entity\Entity\AdEntityInterface.
    -----------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /var/www/html/web/Drupal_9.5/web/modules/contrib/ad_entity_adition/README.md
    ----------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
    ----------------------------------------------------------------------------------
     13 | WARNING | Line exceeds 80 characters; contains 82 characters
     14 | WARNING | Line exceeds 80 characters; contains 88 characters
     15 | WARNING | Line exceeds 80 characters; contains 90 characters
    ----------------------------------------------------------------------------------
    
  • First commit to issue fork.
  • Status changed to Needs review 5 months ago
  • Status changed to RTBC 5 months ago
  • 🇮🇳India riddhi.addweb

    I have applied the MR !4 cleanly and it Resolves all the issues.
    Please check the screenshot for the same.

  • Status changed to Fixed 5 months ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024