Fix the issues reported by phpcs

Created on 3 July 2023, 12 months ago
Updated 4 July 2023, 12 months ago

Problem/Motivation

FILE: /var/www/html/vb/d_cont/menu_tree/menu_tree.module
--------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 5 LINES
--------------------------------------------------------------------------------
22 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
22 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 3
23 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
23 | ERROR | [x] Case breaking statement indented incorrectly; expected 6
| | spaces, found 3
54 | ERROR | [x] Inline control structures are not allowed
68 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
| | question marks, colons, or closing parentheses
72 | ERROR | [x] Inline control structures are not allowed
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/menu_tree/css/menu-tree.css
------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 5 LINES
------------------------------------------------------------------------
1 | ERROR | [x] Multiple selectors should each be on a single line
25 | ERROR | [x] Opening brace should be the last content on the line
25 | ERROR | [x] Closing brace of class definition must be on new line
26 | ERROR | [x] Opening brace should be the last content on the line
26 | ERROR | [x] Closing brace of class definition must be on new line
28 | ERROR | [x] Opening brace should be the last content on the line
28 | ERROR | [x] Closing brace of class definition must be on new line
29 | ERROR | [x] Opening brace should be the last content on the line
29 | ERROR | [x] Closing brace of class definition must be on new line
------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/menu_tree/src/MenuTreeItems.php
--------------------------------------------------------------------------------
FOUND 5 ERRORS AND 4 WARNINGS AFFECTING 9 LINES
--------------------------------------------------------------------------------
10 | WARNING | [x] Unused use statement
16 | WARNING | [ ] The class short comment should describe what the class
| | does and not simply repeat the class name
47 | ERROR | [x] Data types in @var tags need to be fully namespaced
52 | WARNING | [ ] There must be no blank line following an inline comment
74 | ERROR | [ ] The array declaration extends to column 85 (the limit is
| | 80). The array content should be split up over multiple
| | lines
85 | ERROR | [ ] Parameter $exclude is not described in comment
94 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL"
| | but found "null"
103 | ERROR | [ ] The array declaration extends to column 111 (the limit is
| | 80). The array content should be split up over multiple
| | lines
110 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/menu_tree/src/Menu/MenuTreeManipulator.php
------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------
6 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
9 | ERROR | [x] Missing class doc comment
------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------

FILE: /var/www/html/vb/d_cont/menu_tree/menu_tree.install
-----------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
-----------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------

Time: 144ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig menu_tree/

Remaining tasks

Patch review

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

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 @urvashi_vora
  • Status changed to RTBC 12 months ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I reviewed the changes and confirmed the Patch was applied cleanly.

    Checking patch css/menu-tree.css...
    Checking patch menu_tree.install...
    Checking patch menu_tree.module...
    Checking patch menu_tree.services.yml...
    Checking patch src/Menu/MenuTreeManipulator.php...
    Checking patch src/MenuTreeItems.php...
    Applied patch css/menu-tree.css cleanly.
    Applied patch menu_tree.install cleanly.
    Applied patch menu_tree.module cleanly.
    Applied patch menu_tree.services.yml cleanly.
    Applied patch src/Menu/MenuTreeManipulator.php cleanly.
    Applied patch src/MenuTreeItems.php cleanly.

    All PHPCS errors have been fixed.

    I ran this command:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml


    Applied to Menu tree module with 1.0.0 version and with the Drupal core version of 9.5.x.

    Please see the attached screenshots for your reference.

    I'm moving this now to RTBC.

    Thank you!

  • Status changed to Fixed 12 months ago
  • 🇸🇪Sweden Peter Törnstrand

    Commited.

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

Production build 0.69.0 2024