Fix issues reported by PHPCS

Created on 15 April 2024, 6 months ago
Updated 29 April 2024, 5 months ago

Problem/Motivation

See https://git.drupalcode.org/project/domain_menu_access/-/jobs/1330972

FILE: ...om/domain_menu_access/tests/src/Functional/DomainMenuAccessInstallTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is
   |       |     Drupal\domain_access\DomainAccessManagerInterface.
   |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...s/custom/domain_menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is
   |       |     Drupal\Core\Plugin\ContainerFactoryPluginInterface.
   |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...ules/custom/domain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
   7 | ERROR | [x] Use statements should be sorted alphabetically. The first
     |       |     wrong one is Drupal\Core\Access\AccessResult.
     |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 187 | ERROR | [x] Use null coalesce operator instead of ternary operator.
     |       |     (SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.NullCoalesceOperatorNotUsed)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ..._menu_access_menu_block/src/Plugin/Block/DomainMenuAccessMenuMenuBlock.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 7 | ERROR | [x] Use statements should be sorted alphabetically. The first
   |       |     wrong one is
   |       |     Drupal\Core\Plugin\ContainerFactoryPluginInterface.
   |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 198ms; Memory: 6MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE                                                            ERRORS  WARNINGS
--------------------------------------------------------------------------------
...nu_block/src/Plugin/Block/DomainMenuAccessMenuMenuBlock.php  1       0
...ain_menu_access/src/Menu/DomainMenuLinkTreeManipulators.php  2       0
..._menu_access/src/Plugin/Block/DomainMenuAccessMenuBlock.php  1       0
...access/tests/src/Functional/DomainMenuAccessInstallTest.php  1       0
--------------------------------------------------------------------------------
A TOTAL OF 5 ERRORS AND 0 WARNINGS WERE FOUND IN 8 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 5 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------
    SOURCE                                                                 COUNT
--------------------------------------------------------------------------------
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl  4
[x] SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.  1
--------------------------------------------------------------------------------
A TOTAL OF 5 SNIFF VIOLATIONS WERE FOUND IN 2 SOURCES
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SOURCES AUTOMATICALLY (5 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------

Steps to reproduce

Run PHPCS

Proposed resolution

Fix issues

Remaining tasks

Create MR

User interface changes

-

API changes

-

Data model changes

-

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇧🇪Belgium tim-diels Belgium 🇧🇪

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