Fix the issues reported by phpcs

Created on 22 February 2024, 4 months ago
Updated 1 March 2024, 4 months ago

Problem/Motivation

There is a files need to fixed with coding standards.
Here is the command : -
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig web/modules/contrib/paint/
Result :-

FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/README.md
--------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------
 31 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/src/Plugin/Field/FieldFormatter/PaintImageFormatter.php
--------------------
FOUND 9 ERRORS AND 7 WARNINGS AFFECTING 13 LINES
--------------------
  11 | WARNING | [x] Unused use statement
  11 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\File\FileUrlGenerator.
  12 | WARNING | [x] Unused use statement
  26 | ERROR   | [x] Opening brace should be on the same line as the declaration
  32 | ERROR   | [x] Opening brace should be on the same line as the declaration
  41 | ERROR   | [x] There must not be a newline before the closing parenthesis of a single-line function declaration
  47 | ERROR   | [x] Expected newline after closing brace
  71 | ERROR   | [x] Opening brace should be on the same line as the declaration
  84 | ERROR   | [x] Opening brace should be on the same line as the declaration
  92 | WARNING | [x] 'TODO --- Get by glass' should match the format '@todo Fix problem X here.'
  92 | ERROR   | [x] No space found before comment text; expected " TODO --- Get by glass" but found "TODO --- Get by glass"
  92 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
  93 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 106 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
 107 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 108 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
--------------------
PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/src/Plugin/Field/FieldFormatter/PaintDefaultFormatter.php
--------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------
 20 | ERROR   | [x] Opening brace should be on the same line as the declaration
 26 | ERROR   | [x] Opening brace should be on the same line as the declaration
 36 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
 37 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
--------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/src/Plugin/Field/FieldType/PaintItem.php
--------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------
 24 | ERROR | [x] Opening brace should be on the same line as the declaration
 75 | ERROR | [x] Opening brace should be on the same line as the declaration
 76 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 83 | ERROR | [x] Opening brace should be on the same line as the declaration
--------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/src/Plugin/Field/FieldWidget/PaintWidget.php
--------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
--------------------
 22 | ERROR   | [x] Opening brace should be on the same line as the declaration
 43 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 64 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 65 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
 81 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
--------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/templates/paint-image-formatter.html.twig
--------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------
 41 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------


FILE: /home/chandansha/docker/test9/web/modules/CUSTOM/paint/paint.module
--------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
--------------------
  6 | ERROR   | [x] There must be exactly one blank line after the file comment
  7 | ERROR   | [x] Missing function doc comment
  8 | ERROR   | [x] Opening brace should be on the same line as the declaration
  9 | ERROR   | [x] No space found before comment text; expected " $page['#attached']['library'][] = 'paint/paint_paint';" but found "$page['#attached']['library'][] = 'paint/paint_paint';"
 12 | ERROR   | [x] Missing function doc comment
 13 | ERROR   | [x] Opening brace should be on the same line as the declaration
 17 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 23 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
 26 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
 28 | ERROR   | [x] Expected 1 newline at end of file; 0 found
--------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------

Time: 95ms; Memory: 10MB

Steps to reproduce

Run PHPCS on paint module.

Proposed resolution

Fixed the coding standards.

Remaining tasks

Submit the patch either MR .

šŸ“Œ Task
Status

RTBC

Component

Code

Created by

šŸ‡®šŸ‡³India Chandansha

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 @Chandansha
  • šŸ‡®šŸ‡³India Chandansha

    i solve all issue.

  • Status changed to Needs review 4 months ago
  • Status changed to Needs work 4 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied your patch #2 and I can still see many PHPCS errors in the module

    āžœ  paint git:(main) curl https://www.drupal.org/files/issues/2024-02-22/3423100-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  9501  100  9501    0     0  20831      0 --:--:-- --:--:-- --:--:-- 21113
    patching file README.md
    patching file paint.module
    patching file 'src/Plugin/Field/FieldFormatter/PaintDefaultFormatter.php'
    patching file 'src/Plugin/Field/FieldFormatter/PaintImageFormatter.php'
    patching file 'src/Plugin/Field/FieldType/PaintItem.php'
    patching file 'src/Plugin/Field/FieldWidget/PaintWidget.php'
    patching file 'templates/paint-image-formatter.html.twig'
    āžœ  paint git:(main) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml paint 
    
    FILE: /Users/clarksubing-subing/Projects/d9/d9-local/web/modules/contrib/paint/css/paint-paint-widget.css
    ---------------------------------------------------------------------------------------------------------
    FOUND 139 ERRORS AFFECTING 139 LINES
    ---------------------------------------------------------------------------------------------------------
       2 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
       6 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      10 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      11 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      22 | ERROR | [x] Blank lines are not allowed in class definitions
      23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      29 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      34 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      39 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      40 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      41 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      42 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      43 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      44 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      45 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      46 | 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
      54 | ERROR | [x] Blank lines are not allowed in class definitions
      55 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      56 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      57 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      58 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      59 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      63 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      64 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      65 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      66 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      67 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      68 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      72 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      73 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      74 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      75 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      76 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      81 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      82 | ERROR | [x] Blank lines are not allowed in class definitions
      83 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      84 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      85 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      86 | ERROR | [x] Blank lines are not allowed in class definitions
      87 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      88 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      92 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      93 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      94 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      95 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      96 | ERROR | [x] Blank lines are not allowed in class definitions
      97 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      98 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
      99 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     103 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     104 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     105 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     106 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     107 | ERROR | [x] Blank lines are not allowed in class definitions
     108 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     109 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     110 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     114 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     115 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     116 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     117 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     121 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     122 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     123 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     124 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     128 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     129 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     130 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     134 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     135 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     136 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     137 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     138 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     139 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     140 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     141 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     142 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     143 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     144 | ERROR | [x] Blank lines are not allowed in class definitions
     145 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     146 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     147 | ERROR | [x] Blank lines are not allowed in class definitions
     148 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     149 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     150 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     154 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     158 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     162 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     166 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     170 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     174 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     178 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     179 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     180 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     181 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     184 | ERROR | [x] Multiple selectors should each be on a single line
     185 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     186 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     187 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     188 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     189 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     190 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     195 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     199 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     203 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     204 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     205 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     206 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     207 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     211 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     212 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     213 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     214 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     218 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     219 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     220 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     224 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     225 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     226 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     227 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     228 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     233 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     234 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
     235 | ERROR | [x] Expected 1 newline at end of file; 0 found
    ---------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 139 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------
    
    Time: 259ms; Memory: 10MB
    
    āžœ  contrib git:(master) āœ— 
    

    Hence I will move this to needs work

  • Status changed to Needs review 4 months ago
  • šŸ‡®šŸ‡³India Chandansha

    Hii

    i solved all phpcs issue like css and js also.

    Thank @clarkssquared for your help
    Let me know if you find any other issue regarding phpcs.

  • šŸ‡®šŸ‡³India Yashaswi18

    Hello, I applied the patch provided in #5, applies cleanly. However, I found these issues remaining on running the command phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml paint/

    FILE: /home/yashaswi/contribs/paint/src/Plugin/Field/FieldType/PaintItem.php
    -------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    -------------------------------------------------------------------------------------------
     24 | ERROR | [x] Opening brace should be on the same line as the declaration
     75 | ERROR | [x] Opening brace should be on the same line as the declaration
     76 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
     83 | ERROR | [x] Opening brace should be on the same line as the declaration
    -------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/paint/src/Plugin/Field/FieldWidget/PaintWidget.php
    -----------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
    -----------------------------------------------------------------------------------------------
     22 | ERROR   | [x] Opening brace should be on the same line as the declaration
     43 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     64 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     65 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
     81 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
    -----------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/paint/src/Plugin/Field/FieldFormatter/PaintImageFormatter.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 9 ERRORS AND 6 WARNINGS AFFECTING 12 LINES
    ------------------------------------------------------------------------------------------------------------------------
      11 | WARNING | [x] Unused use statement
      11 | ERROR   | [x] Use statements should be sorted alphabetically. The first wrong one is
         |         |     Drupal\Core\File\FileUrlGenerator.
      12 | WARNING | [x] Unused use statement
      26 | ERROR   | [x] Opening brace should be on the same line as the declaration
      32 | ERROR   | [x] Opening brace should be on the same line as the declaration
      41 | ERROR   | [x] There must not be a newline before the closing parenthesis of a single-line function declaration
      47 | ERROR   | [x] Expected newline after closing brace
      71 | ERROR   | [x] Opening brace should be on the same line as the declaration
      84 | ERROR   | [x] Opening brace should be on the same line as the declaration
      92 | WARNING | [x] 'TODO --- Get by glass' should match the format '@todo Fix problem X here.'
      92 | ERROR   | [x] No space found before comment text; expected "// TODO --- Get by glass" but found "//TODO --- Get
         |         |     by glass"
      92 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing
         |         |     parentheses
     106 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
     107 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
     108 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 15 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/paint/src/Plugin/Field/FieldFormatter/PaintDefaultFormatter.php
    ---------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
    ---------------------------------------------------------------------------------------------
     20 | ERROR   | [x] Opening brace should be on the same line as the declaration
     26 | ERROR   | [x] Opening brace should be on the same line as the declaration
     36 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
     37 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
    ---------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/paint/README.md
    ----------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------
     31 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ----------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/paint/paint.module
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
    ------------------------------------------------------------------------------------------------------------------------
      6 | ERROR   | [x] There must be exactly one blank line after the file comment
      7 | ERROR   | [x] Missing function doc comment
      8 | ERROR   | [x] Opening brace should be on the same line as the declaration
      9 | ERROR   | [x] No space found before comment text; expected "// $page['#attached']['library'][] =
        |         |     'paint/paint_paint';" but found "//$page['#attached']['library'][] = 'paint/paint_paint';"
     12 | ERROR   | [x] Missing function doc comment
     13 | ERROR   | [x] Opening brace should be on the same line as the declaration
     17 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
     23 | ERROR   | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
     26 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
     28 | ERROR   | [x] Expected 1 newline at end of file; 0 found
  • šŸ‡®šŸ‡³India Shank115

    Please review this patch.

  • šŸ‡®šŸ‡³India Preethy_ray

    Hi,
    The patch applied cleanly, but I found a few errors and warnings. I have addressed all of them in the updated patch.
    Please Review
    thank You!!

  • Status changed to RTBC 4 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied the updated patch #8 and I confirmed that after applying the patch, all the PHPCS issues were resolved.

    āžœ  paint git:(main) curl https://www.drupal.org/files/issues/2024-03-01/3423100-8.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 21204  100 21204    0     0  45190      0 --:--:-- --:--:-- --:--:-- 45995
    patching file README.md
    patching file 'css/paint-paint-widget.css'
    patching file 'js/paint.js'
    patching file paint.module
    patching file 'src/Plugin/Field/FieldFormatter/PaintDefaultFormatter.php'
    patching file 'src/Plugin/Field/FieldFormatter/PaintImageFormatter.php'
    patching file 'src/Plugin/Field/FieldType/PaintItem.php'
    patching file 'src/Plugin/Field/FieldWidget/PaintWidget.php'
    patching file 'templates/paint-image-formatter.html.twig'
    āžœ  paint git:(main) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml paint            
    āžœ  contrib git:(master) āœ— 
    
    
    
Production build 0.69.0 2024