Fix the issues reported by phpcs

Created on 13 January 2023, about 2 years ago
Updated 23 August 2023, over 1 year ago

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
-----------------------------------------------------------------------------------------------------------------------
📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India noorulshameera

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024