Closed (fixed)
Project:
JSON:API Include
Version:
8.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2024 at 02:18 UTC
Updated:
11 Sep 2024 at 08:49 UTC
Jump to comment: Most recent
After adding the GitLab CI template, several coding standards issues are identified:
FILE: ...de-3438012/web/modules/custom/jsonapi_include-3438012/src/JsonapiParse.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
36 | ERROR | The trigger_error message 'Parsing strings is deprecated
| | deprecated in jsonapi_include:8.x-1.7 and is removed from
| | jsonapi_include:8.x-2.0. Pass the full Response object instead.
| | See
| | https://www.drupal.org/project/jsonapi_include/issues/3374410'
| | does not match the relaxed standard format: %thing% is
| | deprecated in %deprecation-version% any free text
| | %removal-version%. %extra-info%. See %cr-link%
| | (Drupal.Semantics.FunctionTriggerError.TriggerErrorTextLayoutRelaxed)
98 | ERROR | Parameter $key is not described in comment
| | (Drupal.Commenting.FunctionComment.ParamMissingDefinition)
127 | ERROR | Parameter tags must be grouped together in a doc comment
| | (Drupal.Commenting.DocComment.ParamGroup)
147 | ERROR | Parameter tags must be grouped together in a doc comment
| | (Drupal.Commenting.DocComment.ParamGroup)
168 | ERROR | Parameter tags must be grouped together in a doc comment
| | (Drupal.Commenting.DocComment.ParamGroup)
196 | ERROR | Parameter tags must be grouped together in a doc comment
| | (Drupal.Commenting.DocComment.ParamGroup)
--------------------------------------------------------------------------------
FILE: .../custom/jsonapi_include-3438012/src/EventSubscriber/ResponseSubscriber.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first
| | wrong one is Drupal\Core\Cache\CacheableResponseInterface.
| | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 164ms; Memory: 6MB
PHP CODE SNIFFER REPORT SUMMARY
--------------------------------------------------------------------------------
FILE ERRORS WARNINGS
--------------------------------------------------------------------------------
...modules/custom/jsonapi_include-3438012/src/JsonapiParse.php 6 0
..._include-3438012/src/EventSubscriber/ResponseSubscriber.php 1 0
--------------------------------------------------------------------------------
A TOTAL OF 7 ERRORS AND 0 WARNINGS WERE FOUND IN 6 FILES
--------------------------------------------------------------------------------
PHPCBF CAN FIX 1 OF THESE SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------
SOURCE COUNT
--------------------------------------------------------------------------------
[ ] Drupal.Commenting.DocComment.ParamGroup 4
[ ] Drupal.Commenting.FunctionComment.ParamMissingDefinition 1
[ ] Drupal.Semantics.FunctionTriggerError.TriggerErrorTextLayoutRelaxed 1
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl 1
--------------------------------------------------------------------------------
A TOTAL OF 7 SNIFF VIOLATIONS WERE FOUND IN 4 SOURCES
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SOURCES AUTOMATICALLY (1 VIOLATIONS IN TOTAL)
--------------------------------------------------------------------------------
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 #3
ptmkenny commentedComment #4
a.aaronjake commentedHi @ptmkenny,
Reviewed MR !8, all phpcs issues mentioned above were fixed however one issue existed.
Will leave this as "needs review" so others will also give their opinion.
Thank you.
Comment #5
ptmkenny commented@a.aaronjake As noted in my original post, these are the coding standards issues identified by the GitLab CI template.
The GitLab CI template coding standards test classifies dependency injection issues as phpstan issues, not coding standards issues. So the DI issue is fixed here: #3438021: Fix phpstan issues
Comment #6
ptmkenny commentedComment #8
ptmkenny commented