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
Issue fork rest_menu_tree-3476878
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
alyaj2a commentedComment #4
divyansh.gupta commentedHi @alyaj2a
Are you still working on this issue?
Comment #5
batigolixComment #6
batigolixCoding standards issues have been fixed. Phpunit still fails but that is in theory not part of this issue
Comment #7
batigolixComment #8
arjenk commentedReviewed MR !3 with Drupal 11 and PHP 8.4.
All coding changes (mainly formatting) look good and fix the phpcs errors. Dropping phpcs.xml.dist is also logical since Gitlab provides its own version.
A note on the failing unit tests: this is due to dependency module menu_normalizer. There is already a fix for this #3584180: [Drupal 11 / Symfony 7] Fatal error: MenuLinkNormalizer and MenuLinkTreeNormalizer normalize() signature incompatible with NormalizerInterface, and with applying that fix the unit tests go green (at least locally).
So RTBC?
Comment #10
batigolix