Problem/Motivation

PHPCS reports the following issues:

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 elevatezoom

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\elevatezoom\elevatezoom.module
------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 25 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\elevatezoom\README.md
---------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------
  3 | WARNING | [ ] Line exceeds 80 characters; contains 103 characters
 38 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 52 | ERROR   | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\elevatezoom\src\Plugin\Field\FieldFormatter\ImageElevateZoomFormatter.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------
  1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
 13 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

Time: 1.31 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

Comments

sidharth_soman created an issue. See original summary.

sidharth_soman’s picture

Assigned: sidharth_soman » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.04 KB
clarkssquared’s picture

Status: Needs review » Needs work
StatusFileSize
new151.48 KB

Hi sidharth_soman,

I applied your patch to my local and I confirmed that your patch fixed all the PHPCS errors/warnings. However, there is a whitespace error when I apply the patch moving this to needs work and remove the extra whitespace to avoid the said error.

Please look at the screenshot attached for your reference.

Thank you

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB

Fixed whitespace issues in patch #2, please review it.

Thanks & Regards,
Mrinalini

  • mrinalini9 authored 2ecbf567 on 1.x
    Issue #3373856 by sidharth_soman, mrinalini9, clarkssquared: Fix the...
keshavv’s picture

Status: Needs review » Fixed

Thank you.

keshavv’s picture

Status: Fixed » Closed (fixed)

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