Fix the issues reported by PHP_CodeSniffer

Created on 19 August 2020, over 4 years ago
Updated 12 May 2025, 3 days ago

Problem/Motivation

$ phpcs --standard=Drupal .

FILE: /stripe_roles/src/Controller/UserSubscriptionsController.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 8 | WARNING | [x] Unused use statement
-----------------------------------------------------------------------------------------------------------------


FILE: /stripe_roles/src/StripeRolesService.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 21 ERRORS AND 1 WARNING AFFECTING 22 LINES
-------------------------------------------------------------------------------------------------------------------------------------
  42 | ERROR   | [x] Doc comment short description must end with a full stop
  65 | ERROR   | [ ] Parameter $remote_id is not described in comment
  72 | ERROR   | [x] Return comment indentation must be 3 spaces, found 2 spaces
  74 | ERROR   | [ ] Type hint "\Drupal\user\UserInterface" missing for $user
  97 | ERROR   | [ ] Type hint "\Drupal\user\UserInterface" missing for $user
 101 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 4
 109 | ERROR   | [x] Separate the @return and @throws sections by a blank line.
 111 | ERROR   | [ ] Type hint "array" missing for $args
 131 | ERROR   | [ ] Type hint "array" missing for $properties
 154 | ERROR   | [ ] Type hint "array" missing for $properties
 184 | ERROR   | [ ] Description for the @return value is missing
 186 | ERROR   | [ ] Type hint "array" missing for $args
 201 | ERROR   | [ ] Doc comment is empty
 210 | ERROR   | [ ] Missing short description in doc comment
 212 | WARNING | [ ] Line exceeds 80 characters; contains 86 characters
 268 | ERROR   | [ ] Doc comment is empty
 281 | ERROR   | [ ] Missing short description in doc comment
 282 | ERROR   | [ ] Missing parameter comment
 313 | ERROR   | [ ] Doc comment is empty
 319 | ERROR   | [ ] If the line declaring an array spans longer than 80 characters, each element should be broken into its own line
 324 | ERROR   | [ ] Doc comment is empty
 341 | ERROR   | [ ] Doc comment is empty
-------------------------------------------------------------------------------------------------------------------------------------


FILE: /stripe_roles/src/EventSubscriber/WebHookSubscriber.php
------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------
 85 | WARNING | Line exceeds 80 characters; contains 85 characters
 86 | WARNING | Line exceeds 80 characters; contains 81 characters
------------------------------------------------------------------------------------------------------------


FILE: /stripe_roles/src/StripeSubscriptionEntityListBuilder.php
--------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 6 LINES
--------------------------------------------------------------------------------------------------------------
 70 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 71 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 72 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 73 | WARNING | [ ] Line exceeds 80 characters; contains 114 characters
 73 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 8
 74 | ERROR   | [x] Line indented incorrectly; expected 4 spaces, found 6
 76 | ERROR   | [x] Line indented incorrectly; expected 5 spaces, found 4
--------------------------------------------------------------------------------------------------------------

Proposed resolution

Fix the errors as per Drupal coding standards.

User interface changes

NONE

API changes

NONE

Data model changes

NONE

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India ankithashetty Karnataka, India

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024