Fix the issues reported by phpcs

Created on 8 January 2024, 12 months ago
Updated 23 January 2024, 11 months ago

Problem/Motivation

Found Phpcs issue in this module

FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/commerce_from_price/src/Plugin/Field/FieldFormatter/FromPriceDefaultFormatter.php
----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------
29 | ERROR | [x] The first index in a multi-value array must be on a new line
34 | WARNING | [x] A comma should follow the last multiline array item. Found: )
----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 311ms; Memory: 12MB

Steps to reproduce

./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/commerce_from_price

Proposed resolution

Fix all the phpcs issue.

šŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India Ashutosh Ahirwal India

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 @Ashutosh Ahirwal
  • Status changed to Needs review 12 months ago
  • šŸ‡®šŸ‡³India Ashutosh Ahirwal India

    Providing patch with fixes.
    Please review it.

  • Status changed to RTBC 11 months ago
  • šŸ‡µšŸ‡­Philippines clarkssquared

    Hi

    I applied patch #2 and confirmed that it fixes all the PHPCS issues and warnings.

    āžœ  commerce_from_price git:(1.x) curl https://www.drupal.org/files/issues/2024-01-08/phpcs-issue-fixes-3413184-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   769  100   769    0     0   1544      0 --:--:-- --:--:-- --:--:--  1566
    patching file 'src/Plugin/Field/FieldFormatter/FromPriceDefaultFormatter.php'
    āžœ  commerce_from_price git:(1.x) āœ— ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml commerce_from_price 
    āžœ  contrib git:(master) āœ— 
    
    
  • Status changed to Fixed 11 months ago
  • šŸ‡§šŸ‡ŖBelgium fernly

    Thanks for the improvement. Merged.

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

Production build 0.71.5 2024