Problem/Motivation

FILE: .../summary_only/src/Plugin/Field/FieldFormatter/TextSummaryOnlyFormatter.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNINGS AFFECTING 5 LINES
--------------------------------------------------------------------------------
68 | ERROR | [x] Whitespace found at end of line
87 | ERROR | [ ] The array declaration extends to column 87 (the limit is
| | 80). The array content should be split up over multiple
| | lines
115 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
142 | ERROR | [x] Expected 1 blank line after function; 0 found
143 | ERROR | [x] The closing brace for the class must have an empty line
| | before it
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 98ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig summary_only/

Remaining tasks

Patch review

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

urvashi_vora created an issue. See original summary.

ashutosh ahirwal’s picture

Status: Needs review » Needs work

Provided patch apply cleanly but still throwing some remaining errors.

Used command:-
./vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml web/modules/custom/summary_only

Remaining issues.
FILE: /Users/ashutoshahirwal/Sites/lando/contribution/web/modules/custom/summary_only/src/Plugin/Field/FieldFormatter/TextSummaryOnlyFormatter.php
--------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Field\FieldItemListInterface.
85 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
--------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------

Time: 92ms; Memory: 10MB

Gautam_105@ made their first commit to this issue’s fork.

gautam_105@’s picture

Status: Needs work » Needs review
StatusFileSize
new28.3 KB

@Ashutosh Ahirwal , @manishsaharan
i have fixed the issue and created MR for the same . Review the changes and se screenshot as well .

clarkssquared’s picture

Hi Gautam_105@

I applied your MR !1 and I confirmed that it fixes all the PHPCS erros, however, I will retain the status to needs review so that others can thoroughly check your MR. RTBC +1 for me.

➜  summary_only git:(1.0.x) curl https://git.drupalcode.org/project/summary_only/-/merge_requests/1.diff | git apply -v 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  3359    0  3359    0     0   5772      0 --:--:-- --:--:-- --:--:--  5841
Checking patch src/Plugin/Field/FieldFormatter/TextSummaryOnlyFormatter.php...
Applied patch src/Plugin/Field/FieldFormatter/TextSummaryOnlyFormatter.php cleanly.
➜  summary_only git:(1.0.x) ✗ ..
➜  contrib git:(master) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml summary_only 
➜  contrib git:(master) ✗ 

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

manishsaharan’s picture

Thank you so much guys for finding and fixing the issue.

manishsaharan’s picture

Status: Needs review » Fixed

This is working fine, so marking the status to be fixed.
Thanks!

Status: Fixed » Closed (fixed)

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