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

Command icon 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

alyaj2a created an issue. See original summary.

alyaj2a’s picture

Assigned: Unassigned » alyaj2a

divyansh.gupta’s picture

Hi @alyaj2a
Are you still working on this issue?

batigolix’s picture

Assigned: alyaj2a » Unassigned
Issue tags: +finalist-sprint
batigolix’s picture

Status: Active » Needs review

Coding standards issues have been fixed. Phpunit still fails but that is in theory not part of this issue

batigolix’s picture

Priority: Normal » Major
arjenk’s picture

Status: Needs review » Reviewed & tested by the community

Reviewed 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?

batigolix’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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