Fix the issues reported by phpcs

Created on 23 March 2023, almost 2 years ago
Updated 20 August 2024, 4 months ago

Problem/Motivation

Getting following warnings.

FILE: /var/www/html/modules/contrib/cache_alter/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
13 | WARNING | Line exceeds 80 characters; contains 87 characters
15 | WARNING | Line exceeds 80 characters; contains 215 characters
----------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/cache_alter/src/StackMiddleware/ClearRequest.php
------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------
51 | WARNING | Unused variable $query.
------------------------------------------------------------------------------------

Time: 1.07 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/cache_alter/

Proposed resolution

Above warnings need to be fixed.

šŸ“Œ Task
Status

Needs work

Version

1.0

Component

Code

Created by

šŸ‡®šŸ‡³India samit.310@gmail.com

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.

  • Needs reroll

    The patch will have to be re-rolled with new suggestions/changes described in the comments in the issue.

Sign in to follow issues

Comments & Activities

  • Issue created by @samit.310@gmail.com
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • šŸ‡®šŸ‡³India samit.310@gmail.com

    Above warnings has been fixed.

  • šŸ‡®šŸ‡³India rckstr_rohan

    Patch looks good and working as expected.

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs work 4 months ago
  • Hi @everyone,

    The patch provided on the the comments #2 cannot be applied. Please see:

    āžœ  cache_alter git:(8.x-1.x) āœ— curl https://www.drupal.org/files/issues/2023-03-23/3349799-2.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1464  100  1464    0     0  17447      0 --:--:-- --:--:-- --:--:-- 19263
    patching file README.md
    Hunk #1 FAILED at 10.
    1 out of 1 hunk FAILED -- saving rejects to file README.md.rej
    patching file src/StackMiddleware/ClearRequest.php
    Hunk #1 succeeded at 50 with fuzz 2 (offset 2 lines).
    āžœ  cache_alter git:(8.x-1.x) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig cache_alter
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue/web/modules/contrib/cache_alter/README.md
    ----------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
    ----------------------------------------------------------------------------------------------
      7 | WARNING | Line exceeds 80 characters; contains 123 characters
      9 | WARNING | Line exceeds 80 characters; contains 86 characters
     20 | WARNING | Line exceeds 80 characters; contains 88 characters
     23 | WARNING | Line exceeds 80 characters; contains 208 characters
     38 | WARNING | Line exceeds 80 characters; contains 88 characters
     40 | WARNING | Line exceeds 80 characters; contains 214 characters
    ----------------------------------------------------------------------------------------------
    
    Time: 148ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Let's create a merge request, now that patches are no longer tested.

Production build 0.71.5 2024