Fix the issues reported by phpcs

Created on 14 April 2023, almost 2 years ago

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

Needs work

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sidharth_soman
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore

    After running the phpcs command on the module, I found the above coding standard errors/warnings as detailed in the issue summary. I'll work on fixing them.

  • Merge request !12Fixed phpcs issues. ā†’ (Merged) created by sidharth_soman
  • Issue was unassigned.
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command has been used, which arguments have been used, and which report that command shown.

  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India ashutosh ahirwal India

    Updated issue summmary.

  • Status changed to Needs work over 1 year ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    Hi

    I reviewed MR!12 and still getting phpcs issues shown below after running this command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,css,js,yml.

    FILE: ...l.org/drupalorg-site/docroot/modules/contrib/varnish_purge/modules/varnish_purge_tags/src/Tests/CacheTagsTest.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     14 | ERROR | Missing member variable doc comment
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...l.org/drupalorg-site/docroot/modules/contrib/varnish_purge/modules/varnish_image_purge/varnish_image_purge.module
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     125 | WARNING | Unused variable $delta.
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...Users/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/DebugCallGraphTrait.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AFFECTING 4 LINES
    -----------------------------------------------------------------------------------------------------------------------
      11 | ERROR | Doc comment is empty
      30 | ERROR | Description for the @return value is missing
      84 | ERROR | Description for the @return value is missing
     106 | ERROR | Description for the @return value is missing
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...rs/studenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Form/VarnishPurgerForm.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     10 | ERROR | Missing short description in doc comment
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...enttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Form/VarnishBundledPurgerForm.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     10 | ERROR | Missing short description in doc comment
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...tudenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Form/VarnishPurgerFormBase.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
    -----------------------------------------------------------------------------------------------------------------------
      24 | ERROR   | Missing short description in doc comment
      81 | ERROR   | Public method name "VarnishPurgerFormBase::getFormID" is not in lowerCamel format
     256 | ERROR   | Description for the @return value is missing
     362 | WARNING | '@todo' should match the format '@todo Fix problem X here.'
     376 | WARNING | Unused variable $tokens.
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...denttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Entity/VarnishPurgerSettings.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 12 ERRORS AFFECTING 12 LINES
    -----------------------------------------------------------------------------------------------------------------------
      87 | ERROR | Class property $request_method should use lowerCamel naming without underscores
      96 | ERROR | Missing short description in doc comment
     108 | ERROR | Missing short description in doc comment
     117 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
     121 | ERROR | Class property $runtime_measurement should use lowerCamel naming without underscores
     135 | ERROR | Class property $connect_timeout should use lowerCamel naming without underscores
     139 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
     143 | ERROR | Class property $cooldown_time should use lowerCamel naming without underscores
     148 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
     152 | ERROR | Class property $max_requests should use lowerCamel naming without underscores
     157 | ERROR | Missing short description in doc comment
     164 | ERROR | Class property $http_errors should use lowerCamel naming without underscores
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...ainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Tests/VarnishBundledPurgerFormTest.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     26 | ERROR | Missing short description in doc comment
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...udenttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Tests/VarnishPurgerFormTest.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     26 | ERROR | Missing short description in doc comment
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...ttrainees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Tests/VarnishPurgerFormTestBase.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     49 | WARNING | Line exceeds 80 characters; contains 84 characters
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ....org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------
     24 | ERROR   | Missing short description in doc comment
     30 | WARNING | Line exceeds 80 characters; contains 89 characters
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...ees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Plugin/Purge/Purger/VarnishPurgerBase.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     17 | ERROR | Missing short description in doc comment
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: ...nees/Drupal.org/drupalorg-site/docroot/modules/contrib/varnish_purge/src/Plugin/Purge/Purger/ZeroConfigPurger.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 8 ERRORS AND 1 WARNING AFFECTING 9 LINES
    -----------------------------------------------------------------------------------------------------------------------
      46 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
      57 | ERROR   | Doc comment short description must be on a single line, further text should be a separate paragraph
     137 | ERROR   | Description for the @return value is missing
     211 | WARNING | Line exceeds 80 characters; contains 81 characters
     357 | ERROR   | Missing parameter comment
     410 | ERROR   | Missing parameter comment
     515 | ERROR   | Description for the @return value is missing
     524 | ERROR   | Missing parameter comment
     526 | ERROR   | Description for the @return value is missing
    -----------------------------------------------------------------------------------------------------------------------
    
    Time: 767ms; Memory: 14MB

    Please check.
    Thank You.

  • Assigned to nitin_lama
  • Issue was unassigned.
  • šŸ‡®šŸ‡³India nitin_lama India

    Fixed most of the warnings/errors. Only remaining phpcs errors/warnings are these:

    FILE: /home/system/Documents/contribution/varnish_purge-3354158/modules/varnish_purge_tags/src/Tests/CacheTagsTest.php
    ----------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------
     14 | ERROR | Missing member variable doc comment
    ----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/varnish_purge-3354158/src/Entity/VarnishPurgerSettings.php
    -------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------
     150 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/varnish_purge-3354158/src/Plugin/Purge/Purger/ZeroConfigPurger.php
    ------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ------------------------------------------------------------------------------------------------------------------
     46 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
     57 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph
    ------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/varnish_purge-3354158/src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
    -----------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------------------------------------------
     32 | WARNING | Line exceeds 80 characters; contains 89 characters
    -----------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /home/system/Documents/contribution/varnish_purge-3354158/src/Tests/VarnishPurgerFormTestBase.php
    -------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------
     49 | WARNING | Line exceeds 80 characters; contains 84 characters
    -------------------------------------------------------------------------------------------------------
    
    Time: 188ms; Memory: 10MB
    
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India Bhupesh_upadhyay

    All the issues are fixed including the remaining ones, Kindly review.

  • Status changed to RTBC over 1 year ago
  • šŸ‡µšŸ‡­Philippines paraderojether

    I reviewed patch #10, applied against Varnish purger 8.x-2.x-dev, and confirme it fixes the issues reported by phpcs.

    I added screenshots for reference.
    Thank You.

  • Status changed to Needs work over 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
    -  // TODO: Consider are we not doing duplicated work related to varnish_image purge...
    +  // @todo Consider are we not doing duplicated work related to varnish_image purge...

    It is probably either one or the other of these sentences

    Consider we are not duplicating work related to varnish_image purge.

    Consider to avoid duplicating the word done in varnish_image purge.

    -    // @todo
    -    // Validations.
    +    // @todo Validations.

    @todo Add validation. is better.

  • Assigned to nitin_lama
  • šŸ‡®šŸ‡³India nitin_lama India

    Addressed #12. Please review.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Hi, patch #10 fixes all the issues reported by phpcs and patch #12 addresses the issue mentioned in #12.
    Thankyou.

  • Status changed to Needs work about 1 year ago
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹

    Since there is already a MR, let's continue with that.

  • Assigned to nitin_lama
  • Status changed to Needs review about 1 year ago
  • First commit to issue fork.
  • šŸ‡®šŸ‡³India Yashaswi18

    Remaining issues:

    FILE: /home/yashaswi/contribs/varnish_purge/src/Tests/VarnishPurgerFormTestBase.php
    -----------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -----------------------------------------------------------------------------------
     49 | WARNING | Line exceeds 80 characters; contains 84 characters
    -----------------------------------------------------------------------------------
    
    
    FILE: /home/yashaswi/contribs/varnish_purge/src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
    ---------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------
     32 | WARNING | Line exceeds 80 characters; contains 89 characters
    ---------------------------------------------------------------------------------------------------

    Please review.

  • Status changed to Needs work 9 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @Yashaswi18,

    I applied MR!12, it applied smoothly and after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml, these are the issues on my end.

    āžœ  varnish_purge git:(8.x-2.2) curl https://git.drupalcode.org/project/varnish_purge/-/merge_requests/12.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 38758    0 38758    0     0  55785      0 --:--:-- --:--:-- --:--:-- 55766
    patching file modules/varnish_focal_point_purge/varnish_focal_point_purge.module
    patching file modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php
    patching file modules/varnish_image_purge/varnish_image_purge.module
    patching file modules/varnish_purge_tags/src/Plugin/Purge/TagsHeader/CacheTags.php
    patching file modules/varnish_purge_tags/src/Tests/CacheTagsTest.php
    patching file src/DebugCallGraphTrait.php
    patching file src/Entity/VarnishPurgerSettings.php
    patching file src/Form/VarnishBundledPurgerForm.php
    patching file src/Form/VarnishPurgerForm.php
    patching file src/Form/VarnishPurgerFormBase.php
    patching file src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
    patching file src/Plugin/Purge/Purger/VarnishBundledPurger.php
    patching file src/Plugin/Purge/Purger/VarnishPurger.php
    patching file src/Plugin/Purge/Purger/VarnishPurgerBase.php
    patching file src/Plugin/Purge/Purger/ZeroConfigPurger.php
    patching file src/Tests/VarnishBundledPurgerFormTest.php
    patching file src/Tests/VarnishPurgerFormTest.php
    patching file tests/src/Behat/features/bootstrap/VarnishPurgeFeatureContext.php
    āžœ  varnish_purge git:(8.x-2.2) āœ— ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml varnish_purge
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/varnish_purge/modules/varnish_image_purge/src/Form/VarnishImagePurgeConfiguration.php
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------------------
     45 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/varnish_purge/src/Tests/VarnishPurgerFormTestBase.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------
     49 | WARNING | Line exceeds 80 characters; contains 84 characters
    ------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-orgissue/web/modules/contrib/varnish_purge/src/Plugin/Purge/DiagnosticCheck/ConfigurationCheck.php
    ----------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ----------------------------------------------------------------------------------------------------------------------------------------
     32 | WARNING | Line exceeds 80 characters; contains 89 characters
    ----------------------------------------------------------------------------------------------------------------------------------------
    
    Time: 648ms; Memory: 12MB
    
    āžœ  contrib git:(main) āœ—

    Thank you.

  • Pipeline finished with Failed
    9 months ago
    Total: 47s
    #181988
  • First commit to issue fork.
  • Pipeline finished with Failed
    8 months ago
    Total: 43s
    #209289
  • Pipeline finished with Failed
    8 months ago
    #209307
  • Pipeline finished with Failed
    8 months ago
    Total: 44s
    #209316
  • Pipeline finished with Failed
    8 months ago
    Total: 43s
    #209322
  • Pipeline finished with Failed
    8 months ago
    Total: 45s
    #209329
  • Pipeline finished with Failed
    8 months ago
    Total: 44s
    #209339
  • Pipeline finished with Failed
    8 months ago
    Total: 35s
    #209360
  • Status changed to Needs review 8 months ago
  • šŸ‡®šŸ‡³India kalash-j jaipur

    I have fixed all the remaining issues of PHPCS.

  • Pipeline finished with Failed
    8 months ago
    Total: 41s
    #209773
  • Issue was unassigned.
  • Status changed to Needs work 8 months ago
  • šŸ‡®šŸ‡³India atul_ghate

    I have reviewed and applied your changes by converting the merge request into a patch. This resolved all issues except one, which can be fixed by running phpcbf. I am changing the status to "needs work".

  • Pipeline finished with Failed
    8 months ago
    Total: 45s
    #216373
  • Status changed to Needs review 8 months ago
  • šŸ‡®šŸ‡³India kalash-j jaipur

    @atul_ghate I have fixed that error
    there is no phpcs error now

  • Status changed to RTBC 8 months ago
  • šŸ‡®šŸ‡³India atul_ghate

    I have reviewed and applied latest MR 12. it resolved all the phpcs issues, moving to RTBC

  • First commit to issue fork.
  • Pipeline finished with Skipped
    10 days ago
    #423148
  • šŸ‡§šŸ‡ŖBelgium dieterholvoet Brussels
Production build 0.71.5 2024