Fix the issues reported by phpcs

Created on 9 June 2023, over 1 year ago
Updated 6 June 2024, 7 months ago

Run this command phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig and the following warnings/errors reported by phpcs will show.

FILE: /Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/stripe_integration/README.md
-----------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------
  5 | WARNING | Line exceeds 80 characters; contains 105 characters
 15 | WARNING | Line exceeds 80 characters; contains 98 characters
 17 | WARNING | Line exceeds 80 characters; contains 155 characters
 30 | WARNING | Line exceeds 80 characters; contains 98 characters
-----------------------------------------------------------------------------------------------------------


FILE: ...udenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/stripe_integration/stripe_integration.module
------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------
 19 | ERROR   | [ ] String concat is not required here; use a single string instead
 21 | WARNING | [ ] Do not concatenate strings to translatable strings, they should be part of the t() argument
    |         |     and you should use placeholders
 22 | ERROR   | [x] Space found before semicolon; expected "'<br/><a
    |         |     href="/admin/config/system/stripe_integration">Click here to configure</a><br/>';" but found
    |         |     "'<br/><a href="/admin/config/system/stripe_integration">Click here to configure</a><br/>' ;"
 27 | ERROR   | [x] Expected 1 newline at end of file; 4 found
 30 | ERROR   | [ ] More than 2 empty lines are not allowed
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------


FILE: ...enttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/stripe_integration/stripe_integration.info.yml
------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
 1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
 1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
------------------------------------------------------------------------------------------------------------------


FILE: ...pal.org/drupalorg-site/docroot/modules/contrib/stripe_integration/src/Form/StripeIntegrationSettingsForm.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------
  12 | WARNING | [x] Unused use statement
  18 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class
     |         |     name
  73 | ERROR   | [x] Expected 1 blank line after function; 2 found
 102 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for
     |         |     variables
 102 | WARNING | [ ] Translatable strings must not begin or end with white spaces, use placeholders with t() for
     |         |     variables
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------


FILE: ...ees/Drupal.org/drupalorg-site/docroot/modules/contrib/stripe_integration/src/Controller/StripeController.php
------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 4 WARNINGS AFFECTING 6 LINES
------------------------------------------------------------------------------------------------------------------
  18 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class
     |         |     name
  74 | ERROR   | [ ] Parameter $messenger is not described in comment
  86 | ERROR   | [x] Expected 1 space between comma and type hint "Messenger"; 2 found
  86 | ERROR   | [x] Expected one space after the comma, 2 found
 105 | WARNING | [x] There must be no blank line following an inline comment
 105 | WARNING | [ ] There must be no blank line following an inline comment
 148 | WARNING | [ ] Unused variable $submission_id.
 167 | ERROR   | [x] Whitespace found at end of line
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------


FILE: ...upal.org/drupalorg-site/docroot/modules/contrib/stripe_integration/src/Services/StripeIntegrationService.php
------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 1 WARNING AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------
  66 | ERROR   | [ ] Public method name "StripeIntegrationService::get_stripe_environment" is not in lowerCamel
     |         |     format
  76 | ERROR   | [ ] Public method name "StripeIntegrationService::get_stripe_environment_config" is not in
     |         |     lowerCamel format
  86 | ERROR   | [ ] Public method name "StripeIntegrationService::get_current_stripe_environment_config" is not
     |         |     in lowerCamel format
 101 | ERROR   | [ ] Public method name "StripeIntegrationService::create_product_price_payment_link" is not in
     |         |     lowerCamel format
 115 | WARNING | [x] A comma should follow the last multiline array item. Found: TRUE
 159 | ERROR   | [ ] Public method name "StripeIntegrationService::create_checkout_session" is not in lowerCamel
     |         |     format
 198 | ERROR   | [ ] Public method name "StripeIntegrationService::update_config" is not in lowerCamel format
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------

Time: 380ms; Memory: 12MB
๐Ÿ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

๐Ÿ‡ต๐Ÿ‡ญPhilippines paraderojether

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024