Drupal Coding Standards Issues | phpcs

Created on 10 February 2023, about 2 years ago

Problem/Motivation

Getting Following errors/warnings

$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml commerce_product_tax_exempt

FILE: ...1.0\modules\commerce_product_tax_exempt\commerce_product_tax_exempt.module
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found
    |       |     "\r\n"
 30 | ERROR | [ ] The array declaration extends to column 86 (the limit is 80).
    |       |     The array content should be split up over multiple lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...product_tax_exempt\src\Plugin\Commerce\Condition\CustomerRoleCondition.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ules\commerce_product_tax_exempt\src\Resolver\ConditionTaxRateResolver.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found
   |       |     "\r\n"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ommerce_product_tax_exempt\src\Service\CommerceProductTaxExemptManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
 10 | WARNING | [ ] The class short comment should describe what the class does
    |         |     and not simply repeat the class name
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...erce_product_tax_exempt\tests\src\Functional\TaxTypeConditionsFormTest.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
 13 | WARNING | [ ] The class short comment should describe what the class does
    |         |     and not simply repeat the class name
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...odules\commerce_product_tax_exempt\tests\src\Unit\TaxExemptManagerTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found
    |         |     "\r\n"
 17 | WARNING | [ ] The class short comment should describe what the class does
    |         |     and not simply repeat the class name
 46 | ERROR   | [ ] The array declaration extends to column 91 (the limit is
    |         |     80). The array content should be split up over multiple
    |         |     lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 551ms; Memory: 10MB

Proposed resolution

Fix the errors and warnings.

🐛 Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

🇮🇳India jay jangid Jaipur

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

Comments & Activities

Production build 0.71.5 2024