Fix the warnings/errors reported by PHP_CodeSniffer

Created on 10 July 2023, over 1 year ago
Updated 21 July 2023, over 1 year ago

Problem/Motivation
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig /var/www/html/VB/drupal-10.1.0/modules/contrib/paypal_subscriptions/

FILE: /var/www/html/VB/drupal-10.1.0/modules/contrib/paypal_subscriptions/src/Plugin/Commerce/PaymentGateway/ExpressCheckoutSubscriptions.php
------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 13 WARNINGS AFFECTING 13 LINES
------------------------------------------------------------------------------------------------------------------------------------------------
8 | WARNING | [x] Unused use statement
9 | WARNING | [x] Unused use statement
10 | WARNING | [x] Unused use statement
11 | WARNING | [x] Unused use statement
12 | WARNING | [x] Unused use statement
12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\commerce_price\MinorUnitsConverterInterface.
13 | WARNING | [x] Unused use statement
14 | WARNING | [x] Unused use statement
15 | WARNING | [x] Unused use statement
16 | WARNING | [x] Unused use statement
17 | WARNING | [x] Unused use statement
20 | WARNING | [x] Unused use statement
22 | WARNING | [x] Unused use statement
209 | WARNING | [x] '@todo - more about the failures.' should match the format '@todo Fix problem X here.'
------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 14 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce
Run this command
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig /var/www/html/VB/drupal-10.1.0/modules/contrib/paypal_subscriptions/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

RTBC

Version

2.0

Component

Code

Created by

🇮🇳India indrapatil Bangalore

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

  • Issue created by @indrapatil
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.0.7 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    Composer require failure
  • @indrapatil opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I applied the latest MR !3 to the Paypal Subscriptions module against 2.0.x-dev on Drupal 9.5.10 and confirmed all PHPCS errors have been fixed.

    I ran this command:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig paypal_subscriptions/

    Please see the attached file for reference.

    I'm moving this now to RTBC.

    Thank you!

Production build 0.71.5 2024