- Issue created by @BenStallings
- Issue was unassigned.
- Status changed to Needs review
about 1 month ago 4:43am 6 September 2025 - First commit to issue fork.
- First commit to issue fork.
- π¬π§United Kingdom schillerm
Hi, I was getting these phpcs errors.. in !MR21
FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/tests/src/Functional/KeyAuthTest.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/key_auth.module
--------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityTypeInterface.
--------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/src/PageCache/DisallowKeyAuthRequests.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\PageCache\RequestPolicyInterface.
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/src/Authentication/Provider/KeyAuth.php
--------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is
| | Drupal\Core\Authentication\AuthenticationProviderInterface.
--------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/src/Form/UserKeyAuthForm.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\key_auth\KeyAuth.
161 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
174 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
193 | WARNING | [ ] User::load calls should be avoided in classes, use dependency injection instead
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/src/Form/KeyAuthSettingsForm.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\ConfigFormBase.
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/src/KeyAuth.php
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\UserInterface.
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------FILE: /home/laptopuser/Documents/Test2/Dev-10-3528017/web/modules/contrib/key_auth/src/KeyAuthInterface.php
-------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\user\UserInterface.
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------Time: 167ms; Memory: 12MB
I have been through and fixed the issues listed above. This involved mostly reordering use statements and some changes to web/modules/contrib/key_auth/src/Form/UserKeyAuthForm.php. The tests fail but they look like they need updating. I tested the old fashioned way by creating a user and generating and deleting keys etc.. No problems.