Coding Standard Issues

Created on 25 September 2024, about 2 months ago

Problem/Motivation

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

FILE: .../web/modules/custom/rest_menu_tree/src/Plugin/rest/resource/MenuTreeResource.php
--------------------------------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------------------------
18 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Psr\Log\LoggerInterface.
58 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
185 | ERROR | [x] The first parameter of a multi-line function declaration must be on the line after the opening bracket
186 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 42
186 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
218 | ERROR | [x] The first parameter of a multi-line function declaration must be on the line after the opening bracket
219 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 46
219 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
--------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/rest_menu_tree/tests/src/Functional/MenuTreeResourceTest.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------
38 | WARNING | [x] A comma should follow the last multiline array item. Found: 'rest_menu_tree'
50 | ERROR | [x] Expected 1 blank line before function; 2 found
91 | WARNING | [x] A comma should follow the last multiline array item. Found: $format
119 | WARNING | [x] A comma should follow the last multiline array item. Found: 'menu_link_content_list'
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇵🇪Peru alyaj2a

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024