Fix the issue reported by phpcs

Created on 5 August 2023, over 1 year ago
Updated 6 August 2024, 6 months ago

Problem/Motivation

Getting following error/warnings:

FILE: D:\xampp\htdocs\project_10\web\modules\contrib\commerce_shipping_mondial_relay\src\Plugin\Commerce\ShippingMethod\MondialRelay.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------
 154 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
 172 | WARNING | Avoid backslash escaping in translatable strings when possible, use "" quotes instead
----------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run following command:

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

Proposed resolution

Above error/warnings need to be fixed.

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia arti_parmar

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

Merge Requests

Comments & Activities

  • Issue created by @arti_parmar
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia arti_parmar

    Kindly review patch.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Jaspreet-Kaur

    Applied patch #2 it seems to fixed the all erors.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    silvi.addweb โ†’ made their first commit to this issueโ€™s fork.

  • Merge request !1fix the issue reported by phpcs โ†’ (Open) created by Unnamed author
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia dev16.addweb

    Added patch(#2) changes and also resolve below mentioned phpcs issues in MR !1, please review.

    FILE: /commerce_shipping_mondial_relay-3379421/src/Plugin/Commerce/CheckoutPane/MondialRelay.php
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------------------------
     117 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
     132 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    ------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /commerce_shipping_mondial_relay-3379421/src/Plugin/Commerce/ShippingMethod/MondialRelay.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    --------------------------------------------------------------------------------------------------------------------------------------
     51 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 32
     52 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 32
     55 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    --------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------
    
  • Status changed to Needs work 7 months ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi

    I applied patch #2 and confirmed that there's no PHPCS issue a I execute the PHPCS command:

    โžœ  commerce_shipping_mondial_relay git:(1.0.x) curl https://www.drupal.org/files/issues/2023-08-05/3379421-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1632  100  1632    0     0   5136      0 --:--:-- --:--:-- --:--:--  5247
    patching file 'src/Plugin/Commerce/ShippingMethod/MondialRelay.php'
    โžœ  commerce_shipping_mondial_relay git:(1.0.x) โœ— ..
    โžœ  contrib git:(main) โœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml commerce_shipping_mondial_relay/
    โžœ  contrib git:(main) โœ— 
    
    

    However, can you kindly add your changes into the existing MR rather than creating a patch? in that way the maintainer can easily merge and look at it, U will transition this to needs work for that matter.

    • GoZ โ†’ committed 6a2eb841 on 1.0.x
      Issue #3379421 by silvi.addweb, arti_parmar, clarkssquared: Fix the...
  • Status changed to Fixed 6 months ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance goz

    Thanks all

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024