Problem/Motivation

PHPCS reports the following:

C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig hook_post_action

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\hook_post_action\hook_post_action.api.php
-----------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 3 WARNINGS AFFECTING 5 LINES
-----------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  16 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
  30 | WARNING | [ ] Only string literals should be passed to t() where possible
 130 | WARNING | [ ] Only string literals should be passed to t() where possible
 199 | ERROR   | [x] Whitespace found at end of line
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\hook_post_action\hook_post_action.module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 25 | 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."
 25 | ERROR   | [x] Doc comment short description must end with a full stop
 34 | ERROR   | [x] Data types in @param tags need to be fully namespaced
 55 | ERROR   | [x] Namespaced classes/interfaces/traits should be referenced with use statements
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\hook_post_action\hook_post_action_example\hook_post_action_example.module
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 112 | ERROR | [x] Case breaking statements must be followed by a single blank line
 114 | ERROR | [x] Case breaking statements must be followed by a single blank line
 116 | ERROR | [x] Case breaking statements must be followed by a single blank line
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\hook_post_action\README.txt
---------------------------------------------------------------------------------------
FOUND 1 ERROR AND 3 WARNINGS AFFECTING 4 LINES
---------------------------------------------------------------------------------------
  2 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
  4 | WARNING | [ ] Line exceeds 80 characters; contains 121 characters
 21 | WARNING | [ ] Line exceeds 80 characters; contains 105 characters
 26 | ERROR   | [x] Expected 1 newline at end of file; 0 found
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

Time: 1.02 secs; Memory: 6MB

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

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

sidharth_soman created an issue. See original summary.

sidharth_soman’s picture

Assigned: sidharth_soman » Unassigned
Status: Needs work » Needs review
StatusFileSize
new3.67 KB
kenyoowen’s picture

Status: Needs review » Needs work
StatusFileSize
new261.38 KB
new359.31 KB

Hi sidharth_soman

I applied your patch and the remaining issue are the issues line exceeds 80 characters. Please see the screenshots attached.

Thank you.

soham sengupta’s picture

Status: Needs work » Needs review
StatusFileSize
new4.65 KB

Hi, I have fixed the remaining issues.

paraderojether’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new262.74 KB
new38.55 KB

Hi Soham Sengupta,

I reviewed patch #4, applied against Hook Post Action 8.x-1.x-dev, and confirmed it fixes all the issues reported by phpcs.

I added a screenshot for reference.
Thank you.

m4olivei made their first commit to this issue’s fork.

  • m4olivei committed 12dd17a1 on 8.x-1.x
    feat: #3373830 Fix the issues reported by phpcs
    
    By: @sidharth_soman
    By...
m4olivei’s picture

Status: Reviewed & tested by the community » Fixed

Thanks all! Merged to 8.x-1.x 🎉

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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