Phpcs Drupal coding standard issue

Created on 13 July 2022, about 2 years ago
Updated 17 July 2024, 2 months ago

FILE: D:\xampp\htdocs\drupal9.5\web\modules\contrib\layout_builder_accordion\layout_builder_accordion.module
------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
12 | ERROR | [x] Missing function doc comment
12 | ERROR | [x] Expected 1 space before opening brace; found 0
13 | ERROR | [x] Expected 1 space before "="; 0 found
13 | ERROR | [x] Expected 1 space before "==="; 0 found
13 | ERROR | [x] Expected 1 space after "==="; 0 found
13 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but found "null"
14 | ERROR | [x] Expected 1 space before "="; 0 found
14 | ERROR | [x] Expected 1 space before "==="; 0 found
14 | ERROR | [x] Expected 1 space after "==="; 0 found
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal9.5\web\modules\contrib\layout_builder_accordion\src\Plugin\Layout\AccordionsLayout.php
-------------------------------------------------------------------------------------------------------------------
FOUND 37 ERRORS AND 2 WARNINGS AFFECTING 26 LINES
-------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
14 | ERROR | [x] 2 spaces found before inline comment; expected "// /**" but found "// /**"
15 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
15 | ERROR | [ ] Comment indentation error, expected only 2 spaces
16 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
17 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
18 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
18 | ERROR | [ ] Comment indentation error, expected only 2 spaces
19 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
20 | WARNING | [ ] Line exceeds 80 characters; contains 83 characters
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
21 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
22 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
22 | ERROR | [ ] Comment indentation error, expected only 4 spaces
23 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
24 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
25 | WARNING | [x] There must be no blank line following an inline comment
25 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
27 | ERROR | [x] You must use "/**" style comments for a function comment
36 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
41 | ERROR | [x] Missing function doc comment
42 | ERROR | [x] Opening brace should be on the same line as the declaration
43 | ERROR | [x] Expected 1 space before "="; 0 found
44 | ERROR | [x] Expected 1 space before "="; 0 found
44 | ERROR | [x] Expected 1 space after "="; 0 found
48 | ERROR | [x] Missing function doc comment
49 | ERROR | [x] Opening brace should be on the same line as the declaration
51 | ERROR | [x] Expected 1 space before "="; 0 found
51 | ERROR | [x] Expected 1 space after "="; 0 found
52 | ERROR | [x] Expected 1 space after IF keyword; 0 found
52 | ERROR | [x] Expected 1 space before "==="; 0 found
52 | ERROR | [x] Expected 1 space after "==="; 0 found
52 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
53 | ERROR | [x] Expected 1 space before "="; 0 found
53 | ERROR | [x] Expected 1 space after "="; 0 found
53 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
56 | ERROR | [x] Expected 1 blank line after function; 2 found
59 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 35 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

FILE: D:\xampp\htdocs\drupal9.5\web\modules\contrib\layout_builder_accordion\src\TwigExtension\SortByWeight.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
---------------------------------------------------------------------------------------------------------------

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇮🇳India Harsh panchal

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

Comments & Activities

Not all content is available!

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

  • 🇮🇳India dev16.addweb

    After testing, I was unable to locate any issues or warnings.

  • 🇵🇭Philippines clarkssquared

    Hi

    I applied the patch but it fails and being rejected

    ➜  layout_builder_accordion git:(1.x) curl https://www.drupal.org/files/issues/2022-07-13/phpcs-drupal-standard-3295736-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  3537  100  3537    0     0  12160      0 --:--:-- --:--:-- --:--:-- 12498
    patching file layout_builder_accordion.module
    No such line 11 in input file, ignoring
    1 out of 1 hunks failed--saving rejects to layout_builder_accordion.module.rej
    patching file 'src/Plugin/Layout/AccordionsLayout.php'
    2 out of 2 hunks failed--saving rejects to 'src/Plugin/Layout/AccordionsLayout.php.rej'
  • 🇮🇳India dev16.addweb

    Hello,

    Without adding the patch, I haven't noticed any issues or warnings. Perhaps it has already been fixed.

  • 🇮🇳India riddhi.addweb

    Without applying the patch, no errros were displayed only some warnings were displayed. Attaching SS for the same.

Production build 0.71.5 2024