Fix the warnings/errors reported by PHP_CodeSniffer

Created on 27 June 2023, over 1 year ago
Updated 3 July 2023, over 1 year ago

Use the below command with arguments:-
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/lb_webform

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/lb_webform/lb_webform.info.yml
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
-------------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/lb_webform/README.md
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/lb_webform/lb_webform.module
-----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------
16 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
23 | ERROR | [x] Expected 1 space before opening brace; found 0
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/lb_webform/assets/css/lb-webform.css
-------------------------------------------------------------------------------------------------------------
FOUND 58 ERRORS AFFECTING 47 LINES
-------------------------------------------------------------------------------------------------------------
3 | ERROR | [x] Closing brace of class definition must be on new line
4 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
6 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
7 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
7 | ERROR | [x] Closing brace of class definition must be on new line
11 | ERROR | [x] Closing brace of class definition must be on new line
12 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
15 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
15 | ERROR | [x] Closing brace of class definition must be on new line
19 | ERROR | [x] Closing brace of class definition must be on new line
20 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
24 | ERROR | [x] Closing brace of class definition must be on new line
25 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
26 | ERROR | [x] Multiple selectors should each be on a single line
27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
28 | ERROR | [x] Closing brace of class definition must be on new line
29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
29 | ERROR | [x] Multiple selectors should each be on a single line
30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
30 | ERROR | [x] Closing brace of class definition must be on new line
31 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
32 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
36 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
37 | ERROR | [x] Closing brace of class definition must be on new line
38 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
39 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
40 | ERROR | [x] Closing brace of class definition must be on new line
43 | ERROR | [x] Closing brace of class definition must be on new line
44 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
49 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
51 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
52 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
53 | ERROR | [x] Closing brace of class definition must be on new line
54 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
55 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
56 | ERROR | [x] Closing brace of class definition must be on new line
58 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 58 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

Time: 309ms; Memory: 10MB

Fix the phpcs issue found after phpcs command

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @sonam_sharma
  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines paraderojether

    Hi sonam_sharma,
    After running this command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig lb_webform, I'm getting different result from the issue listed in the summary, and patch #2 is not applicable for the phpcs issues.

    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/lb_webform/lb_webform.info.yml
    ----------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------
     9 | WARNING | All dependencies must be prefixed with the project name, for example "drupal:"
    ----------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/lb_webform/README.md
    ------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/lb_webform/lb_webform.module
    --------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    --------------------------------------------------------------------------------------------------------------
     16 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
     23 | ERROR   | [x] Expected 1 space before opening brace; found 0
    --------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/lb_webform/assets/css/lb-webform.css
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 58 ERRORS AFFECTING 47 LINES
    ----------------------------------------------------------------------------------------------------------------------
      3 | ERROR | [x] Closing brace of class definition must be on new line
      4 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
      5 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      6 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
      7 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
      7 | ERROR | [x] Closing brace of class definition must be on new line
     11 | ERROR | [x] Closing brace of class definition must be on new line
     12 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     13 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     14 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
     15 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
     15 | ERROR | [x] Closing brace of class definition must be on new line
     19 | ERROR | [x] Closing brace of class definition must be on new line
     20 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     24 | ERROR | [x] Closing brace of class definition must be on new line
     25 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     26 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     26 | ERROR | [x] Multiple selectors should each be on a single line
     27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
     28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
     28 | ERROR | [x] Closing brace of class definition must be on new line
     29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     29 | ERROR | [x] Multiple selectors should each be on a single line
     30 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 8
     30 | ERROR | [x] Closing brace of class definition must be on new line
     31 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     32 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     33 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     35 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     36 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     37 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     37 | ERROR | [x] Closing brace of class definition must be on new line
     38 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     39 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     40 | ERROR | [x] Closing brace of class definition must be on new line
     43 | ERROR | [x] Closing brace of class definition must be on new line
     44 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 2
     45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     46 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     47 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     48 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     49 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     50 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     51 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     52 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     53 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     53 | ERROR | [x] Closing brace of class definition must be on new line
     54 | ERROR | [x] Line indented incorrectly; expected 0 spaces, found 4
     55 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
     56 | ERROR | [x] Closing brace of class definition must be on new line
     58 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ----------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 58 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------
    
    Time: 238ms; Memory: 10MB

    Please check.
    Thank You.

  • Issue was unassigned.
  • 🇮🇳India Ashutosh Ahirwal India

    I have updated the issue summary with the command, arguments, and issue found in the module after the command run.
    @sonam_sharma Mention the correct issue summary found after the phpcs command if you are giving a title like "Fix the issues reported by phpcs" then all the issues found after the command run should be mentioned and creating multiple issues using a single command it's not a correct way.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India Ashutosh Ahirwal India

    Providing updated patch fixes with phpcbf.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹
  • Status changed to Fixed over 1 year ago
  • 🇺🇦Ukraine podarok Ukraine

    guys, used to Merge Request, drop this patch upload please, in the future.

    tnx, merged

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

Production build 0.71.5 2024