Problem/Motivation

There are various PHPCS failures when testing against Drupal 9

phpcs .                                                                                                                   mglaman@Matts-MBP
..W...E...WE..WW...E......W... 30 / 30 (100%)



FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/tests/modules/jsonapi_resources_test/src/Resource/CurrentUserInfo.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------
 122 | WARNING | [x] '@todo: convert this to a ResourceTypeRelationship.' should match the format '@todo Fix problem X here.'
 127 | WARNING | [x] '@todo: Add role entities as a relatable resource type.' should match the format '@todo Fix problem X here.'
----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/tests/src/Unit/Routing/ResourceRoutesTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
 33 | ERROR | The array declaration extends to column 149 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/src/Entity/Query/PaginatorMetadata.php
----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------
 7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
----------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/src/Unstable/DocumentExtractor.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
  22 | ERROR   | [x] Non-namespaced classes/interfaces/traits should not be referenced with use statements
 123 | ERROR   | [ ] The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
 137 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/src/Unstable/Entity/EntityCreationTrait.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 62 | WARNING | [x] '@todo: remove the assignment of the entity type manager to a variable when an "Aware" interface is added.' should match the format '@todo Fix problem X here.'
 63 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
 64 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/src/Unstable/Entity/Query/Pagination/OffsetLimitPaginator.php
-------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------
 108 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/src/Unstable/Controller/JsonapiResourceController.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 64 | ERROR | The array declaration extends to column 82 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/mglaman/Drupal/modules/jsonapi_resources/src/Resource/ResourceBase.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 118 | WARNING | [x] '@todo: try to move this exception into Drupal\jsonapi_resources\Routing\ResourceRoutes::ensureResourceImplementationValid().' should match the format '@todo Fix
     |         |     problem X here.'
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 2.15 secs; Memory: 12MB
CommentFileSizeAuthor
#2 3189204-2.patch4.91 KBmglaman

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
StatusFileSize
new4.91 KB

Some of the rules are overzealous – like array length when inside of a method call.

  • mglaman committed 055bf29 on 8.x-1.x
    Issue #3189204 by mglaman: Fix PHPCS
    
mglaman’s picture

Assigned: mglaman » Unassigned
Status: Needs review » Fixed

Fixed!

Status: Fixed » Closed (fixed)

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