Fix the issues reported by PHPCS

Created on 17 April 2023, about 1 year ago
Updated 1 May 2023, about 1 year ago

Problem/Motivation

FILE: ...odules/contrib/api_toolkit/src/EventSubscriber/ExceptionJsonSubscriber.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
211 | WARNING | Line exceeds 80 characters; contains 104 characters
--------------------------------------------------------------------------------

FILE: ...ules/contrib/api_toolkit/src/EventSubscriber/MaintenanceModeSubscriber.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
133 | WARNING | Line exceeds 80 characters; contains 104 characters
--------------------------------------------------------------------------------

FILE: ...0/web/modules/contrib/api_toolkit/src/Exception/ApiValidationException.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
96 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------------

FILE: ...rupal10/web/modules/contrib/api_toolkit/src/Response/PagedJsonResponse.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
16 | ERROR | Doc comment short description must be on a single line, further
| | text should be a separate paragraph
--------------------------------------------------------------------------------

FILE: ...upal10/web/modules/contrib/api_toolkit/src/Validation/ValidatorFactory.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
38 | WARNING | Line exceeds 80 characters; contains 95 characters
--------------------------------------------------------------------------------

FILE: ...10/web/modules/contrib/api_toolkit/src/Normalizer/ApiRequestNormalizer.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
26 | ERROR | Doc comment is empty
45 | WARNING | Line exceeds 80 characters; contains 81 characters
64 | ERROR | Parameter $classMetadataFactory is not described in comment
64 | ERROR | Parameter $nameConverter is not described in comment
64 | ERROR | Parameter $propertyAccessor is not described in comment
64 | ERROR | Parameter $propertyTypeExtractor is not described in comment
64 | ERROR | Parameter $classDiscriminatorResolver is not described in
| | comment
64 | ERROR | Parameter $objectClassResolver is not described in comment
64 | ERROR | Parameter $defaultContext is not described in comment
237 | WARNING | Line exceeds 80 characters; contains 87 characters
--------------------------------------------------------------------------------

FILE: ...on/drupal10/web/modules/contrib/api_toolkit/src/Request/ApiRequestBase.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
32 | WARNING | Line exceeds 80 characters; contains 87 characters
47 | WARNING | Line exceeds 80 characters; contains 87 characters
66 | WARNING | Line exceeds 80 characters; contains 87 characters
81 | WARNING | Line exceeds 80 characters; contains 87 characters
--------------------------------------------------------------------------------

FILE: ...t/modules/api_toolkit_examples/src/Controller/ExamplePageApiController.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
27 | ERROR | Missing @var tag in member variable comment
32 | ERROR | Missing @var tag in member variable comment
37 | ERROR | Missing @var tag in member variable comment
42 | ERROR | Missing @var tag in member variable comment
--------------------------------------------------------------------------------

FILE: ...lkit/modules/api_toolkit_examples/src/Normalizer/ExamplePageNormalizer.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
34 | ERROR | Type hint "\Drupal\api_toolkit_examples\Entity\ExamplePage"
| | missing for $object
--------------------------------------------------------------------------------

FILE: ...toolkit/modules/api_toolkit_examples/src/Normalizer/LinkItemNormalizer.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
34 | ERROR | Type hint "\Drupal\link\LinkItemInterface" missing for $object
--------------------------------------------------------------------------------

FILE: ...odules/api_toolkit_examples/src/Normalizer/ExamplePageSimpleNormalizer.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
34 | ERROR | Type hint "\Drupal\api_toolkit_examples\Entity\ExamplePage"
| | missing for $object
--------------------------------------------------------------------------------

FILE: ...olkit/modules/api_toolkit_examples/src/Normalizer/UserSimpleNormalizer.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
34 | ERROR | Type hint "\Drupal\user\UserInterface" missing for $object
--------------------------------------------------------------------------------

FILE: ...ules/api_toolkit_examples/src/Request/CreateOrUpdateExamplePageRequest.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
7 | WARNING | [x] Unused use statement
26 | ERROR | [ ] Missing @var tag in member variable comment
38 | ERROR | [ ] Missing @var tag in member variable comment
55 | ERROR | [ ] Missing @var tag in member variable comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: .../api_toolkit/modules/api_toolkit_examples/api_toolkit_examples.routing.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
8 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
17 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
32 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
47 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
56 | WARNING | Open page callback found, please add a comment before the line
| | why there is no access restriction
--------------------------------------------------------------------------------

FILE: .../contribution/drupal10/web/modules/contrib/api_toolkit/api_toolkit.install
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
4 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
20 | ERROR | [x] Expected 1 blank line after function; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...pal10/web/modules/contrib/api_toolkit/config/schema/api_toolkit.schema.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
10 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.7 secs; Memory: 12MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig api_toolkit/

Proposed resolution

Fix all reported issues for Drupal and DrupalPractice standards

Remaining tasks

Patch review and fix remaining issues.

FILE: ...lkit/modules/api_toolkit_examples/src/Normalizer/ExamplePageNormalizer.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
--------------------------------------------------------------------------------

FILE: ...toolkit/modules/api_toolkit_examples/src/Normalizer/LinkItemNormalizer.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
--------------------------------------------------------------------------------

FILE: ...odules/api_toolkit_examples/src/Normalizer/ExamplePageSimpleNormalizer.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
--------------------------------------------------------------------------------

FILE: ...olkit/modules/api_toolkit_examples/src/Normalizer/UserSimpleNormalizer.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
31 | ERROR | Parameter type "array{cacheability: CacheableMetadata|null}" must
| | not contain spaces
--------------------------------------------------------------------------------

Time: 1.7 secs; Memory: 12MB

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024