Fix the issues reported by phpcs

Created on 15 March 2023, almost 2 years ago
Updated 24 July 2024, 5 months ago

GitLab CI reports PHP_CodeSniffer errors/warnings which should be fixed.

šŸ“Œ Task
Status

Needs review

Version

3.1

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.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @samit.310@gmail.com
  • šŸ‡®šŸ‡³India samit.310@gmail.com

    Above warnings has been fixed.

  • šŸ‡®šŸ‡³India rajneeshb New Delhi

    Reviewed patch #2 LGTM, all reported issue fixed. +1RTBC

    Attaching SS for reference.

  • Status changed to Needs review almost 2 years ago
  • Issue was unassigned.
  • Status changed to Needs work almost 2 years ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
    -    $page = $this->getSession()->getPage();
    +    // $page = $this->getSession()->getPage();
    

    If a line is initializing a variable that is never used, that line needs to be removed, not commented out.
    Also, the variable could be not necessary, but $this->getSession()->getPage() could still be necessary. Has that been checked?

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 10.0.7 + Environment: PHP 8.1 & MySQL 8
    last update over 1 year ago
    5 pass
  • šŸ‡®šŸ‡³India chaitanyadessai Goa

    Adding patch and interdiff file, please review

  • Status changed to Needs work 5 months ago
  • Hi @everyone,

    The patch @chaitanyadessai provided confirmed removed the unused variable as raised by comment #5, but one error were still reported that needs to be fixed. Please see below:

    readmore_extrafield git:(3.1.x) curl https://www.drupal.org/files/issues/2023-05-13/3348047-6.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1440  100  1440    0     0   5198      0 --:--:-- --:--:-- --:--:--  5373
    patching file src/Plugin/ExtraField/Display/ReadmoreExtrafield.php
    patching file tests/src/FunctionalJavascript/ReadMoreExtraFieldFunctionalJavascriptTest.php
    āžœ  readmore_extrafield git:(3.1.x) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig readmore_extrafield
    
    FILE: /Users/PrometInterns/Demo-site/drupal-orgissue-v9/web/modules/contrib/readmore_extrafield/src/Plugin/ExtraField/Display/ReadmoreExtrafield.php
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------------------
     7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 221ms; Memory: 10MB

    Kindly check

    Thanks,
    Jake

  • Status changed to Needs review 5 months ago
  • šŸ‡®šŸ‡³India chaitanyadessai Goa

    @a.aaronjake please review.

  • First commit to issue fork.
  • Status changed to RTBC 5 months ago
  • Hi @chaitanyadessai,

    The patch you provided did fix the errors.

    readmore_extrafield git:(3.1.x) āœ— curl https://www.drupal.org/files/issues/2024-07-23/3348047-8.patch | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1603  100  1603    0     0   6515      0 --:--:-- --:--:-- --:--:--  6735
    patching file src/Plugin/ExtraField/Display/ReadmoreExtrafield.php
    patching file tests/src/FunctionalJavascript/ReadMoreExtraFieldFunctionalJavascriptTest.php
    āžœ  readmore_extrafield git:(3.1.x) āœ— cd ..
    āžœ  contrib git:(master) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig readmore_extrafield
    āžœ  contrib git:(master) āœ—

    Will now move this to RTBC

    Thanks,
    Jake

  • Status changed to Needs work 5 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

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

  • Pipeline finished with Success
    5 months ago
    Total: 214s
    #233246
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Status changed to Needs review 5 months ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Pipeline finished with Success
    5 months ago
    Total: 153s
    #233265
Production build 0.71.5 2024