PHP Coding standard issue

Created on 13 February 2023, almost 2 years ago
Updated 27 February 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/web/modules/custom/commerce_view_receipt/commerce_view_receipt.module
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] Missing file doc comment
  4 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
    |         |     hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
 10 | ERROR   | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/commerce_view_receipt/README.txt
-----------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------
 34 | ERROR | [x] Expected 1 newline at end of file; 2 found
-----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------


FILE: /var/www/html/web/modules/custom/commerce_view_receipt/src/Controller/ReceiptController.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AND 1 WARNING AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 11 | ERROR   | [x] Doc comment short description must end with a full stop
 15 | ERROR   | [x] The open comment tag must be the only content on the line
 15 | ERROR   | [ ] Missing short description in doc comment
 15 | ERROR   | [x] Expected "\Drupal\commerce_order\OrderTotalSummaryInterface" but found "\Drupal\commerce_order\OrderTotalSummaryInterface " for @var tag in member variable comment
 19 | ERROR   | [x] Doc comment short description must end with a full stop
 35 | ERROR   | [x] Doc comment short description must end with a full stop
 48 | WARNING | [x] A comma should follow the last multiline array item. Found: )
 52 | ERROR   | [x] Expected 1 newline at end of file; 2 found
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 7 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run the phpcs --standard="DrupalPractice,DrupalStandard" commerce_view_receipt

Proposed resolution

Fix all the valid Drupal coding standard issues.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India arunkumark Coimbatore

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

Comments & Activities

  • Issue created by @arunkumark
  • @arunkumark opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India arunkumark Coimbatore

    Created the merge request to resolve the coding standard issue.

  • 🇮🇳India nayana_mvr

    Verified the patch #3 on Drupal version 9.5.x and Commerce View Receipt version 1.0.x. The patch applied cleanly but there is still one minor issue

    FILE: ../commerce_view_receipt/commerce_view_receipt.module
    ---------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------
     15 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ---------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ../commerce_view_receipt/README.txt
    ---------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------
     34 | ERROR | [x] Expected 1 newline at end of file; 2 found
    ---------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ---------------------------------------------------------------------------------------------------

    I think README.txt file issue can be ignored as it will be replaced with README.md as per ticket 3341190 📌 Replace README.txt with README.md and update README.md file Fixed

  • 🇮🇳India sahil.goyal

    Addressed #4 and resolve left warnings left.

  • First commit to issue fork.
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024