Fix the issues reported by phpcs

Created on 11 July 2023, over 1 year ago
Updated 7 February 2024, 9 months ago

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

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia urvashi_vora Madhya Pradesh, India

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

Merge Requests

Comments & Activities

  • Issue created by @urvashi_vora
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Ashutosh Ahirwal India

    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

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gautam_105@

    Gautam_105@ โ†’ made their first commit to this issueโ€™s fork.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Gautam_105@

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

  • Merge request !1Fixed the issues reported by phpcs โ†’ (Merged) created by Gautam_105@
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    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) โœ— 
    
  • First commit to issue fork.
  • Pipeline finished with Skipped
    10 months ago
    #81788
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia manishsaharan New Delhi
  • Status changed to Fixed 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia manishsaharan New Delhi

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

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

Production build 0.71.5 2024