Fix the issues reported by phpcs

Created on 29 March 2023, about 1 year ago
Updated 8 March 2024, 4 months ago

Problem/Motivation

Getting following errors.

FILE: /var/www/html/modules/contrib/commerce_tax_conditions/commerce_tax_conditions.module
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
30 | ERROR | The array declaration extends to column 84 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/commerce_tax_conditions/tests/src/Unit/TaxExemptManagerTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
46 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/commerce_tax_conditions/src/Plugin/Commerce/Condition/CustomerRoleCondition.php
-------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------
27 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
28 | ERROR | [x] Array closing indentation error, expected 4 spaces but found 6
-------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------

Time: 2.34 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/commerce_tax_conditions/

Proposed resolution

Above errors need to be fixed.

šŸ“Œ Task
Status

RTBC

Version

1.2

Component

Code

Created by

šŸ‡®šŸ‡³India samit.310@gmail.com

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

  • Issue created by @samit.310@gmail.com
  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • šŸ‡®šŸ‡³India samit.310@gmail.com

    Above errors has been fixed.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    Hi I have found one remaining error after applying #2 patch.
    Providing updated patch.

  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.2.1 + Environment: PHP 8.1 & MariaDB 10.3.22
    last update 4 months ago
    run-tests.sh fatal error
  • Status changed to RTBC 4 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied patch #4 and I confirmed that all PHPCS issues were resolved, the remaining issue that my terminal flagged happens when the module is installed via composer.

    āžœ  commerce_tax_conditions git:(master) āœ— curl https://www.drupal.org/files/issues/2024-03-05/3350996-4.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  2826  100  2826    0     0   6325      0 --:--:-- --:--:-- --:--:--  6422
    patching file commerce_tax_conditions.module
    patching file 'src/Plugin/Commerce/Condition/CustomerRoleCondition.php'
    patching file 'src/Resolver/ConditionTaxRateResolver.php'
    patching file 'tests/src/Unit/TaxExemptManagerTest.php'
    āžœ  commerce_tax_conditions git:(master) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml commerce_tax_conditions
    
    FILE: ...b/modules/contrib/commerce_tax_conditions/commerce_tax_conditions.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
    --------------------------------------------------------------------------------
    
    Time: 313ms; Memory: 10MB
    
    āžœ  contrib git:(master) āœ— 
Production build 0.69.0 2024