Steps to reproduce

Run following command
phpcs --standard=“Drupal,DrupalPractice” --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .

Problem/Motivation


FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/commerce_webform_order/README.md
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------
  4 | WARNING | Line exceeds 80 characters; contains 142 characters
  8 | WARNING | Line exceeds 80 characters; contains 172 characters
 10 | WARNING | Line exceeds 80 characters; contains 137 characters
 15 | WARNING | Line exceeds 80 characters; contains 89 characters
---------------------------------------------------------------------------------------


FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/commerce_webform_order/commerce_webform_order.install
------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------
 54 | ERROR | [x] Expected 1 space after CATCH keyword; 0 found
 54 | ERROR | [x] Newline required after opening brace
 54 | ERROR | [x] Closing brace must be on a line by itself
------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------


FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/commerce_webform_order/src/Plugin/WebformHandler/CommerceWebformOrderHandler.php
-----------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------
 412 | WARNING | [x] '@TODO: Use AJAX to reload order item bundle fields on product variation change.' should match the format '@todo Fix problem X here.'
 436 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 441 | WARNING | [x] '@TODO: Use the same type of this order item field.' should match the format '@todo Fix problem X here.'
 786 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
-----------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /Applications/MAMP/htdocs/d9/web/modules/contrib/commerce_webform_order/src/Element/EntityAutocompleteOrToken.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
 185 | ERROR | [x] Use null coalesce operator instead of ternary operator.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------
CommentFileSizeAuthor
#4 webform_comm.png94.78 KBatul_ghate
#2 3333154-2.patch4.68 KBnoorulshameera
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

noorulshameera created an issue. See original summary.

noorulshameera’s picture

Status: Active » Needs review
StatusFileSize
new4.68 KB

Adding patch with issues fixed.

atul_ghate’s picture

Assigned: Unassigned » atul_ghate

I will review this patch.

atul_ghate’s picture

Assigned: atul_ghate » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new94.78 KB

I've applied the patch cleanly and it resolved all the phpcs issues, moving to RTBC

Charchil Khandelwal made their first commit to this issue’s fork.

charchil khandelwal’s picture

Created MR !2 for this issue.
Please review.

Thank you.

avpaderno’s picture

Title: Drupal coding standard fix | PHPCS » Fix the issues reported by phpcs
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

imustakim’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update

Issue summary updated.

avpaderno’s picture

Priority: Normal » Minor
Status: Needs review » Needs work
-    * Product variation (allowing to override certain properties such price or currency).
+    * Product variation (allowing to override certain properties
+    such price or currency).

The such price or currency). part must be indented respect the previous line.

facine’s picture

Status: Needs work » Fixed

Fixed, thanks!

Status: Fixed » Closed (fixed)

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