Fix the issues reported by phpcs

Created on 28 June 2023, over 1 year ago
Updated 10 July 2024, 5 months ago

Problem/Motivation

----------------------------------------------------------------------------------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
39 | ERROR | [ ] Parameter $logger is not described in comment
44 | ERROR | [ ] Missing parameter name
84 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
94 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
123 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead

80 | WARNING | Exceptions should not be translated
90 | WARNING | Exceptions should not be translated
96 | WARNING | Exceptions should not be translated
117 | WARNING | Exceptions should not be translated
---------------------------------------------------------

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇮🇳India yashmalviya

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

Comments & Activities

  • Issue created by @yashmalviya
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India yashmalviya

    I have made some changes in #2 Patch. Please review.

  • Status changed to Needs work over 1 year ago
  • 🇵🇭Philippines paraderojether

    Hi @yashmalviya

    I reviewed patch #2, applied against 2.0.2, and there are still remaining warnings shown below after applying the patch:

    FILE: /Users/studenttrainees/Drupal/drupalorg-issues-site/docroot/modules/contrib/purge_invalidation_form/purge_invalidation_form.info.yml
    ------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    ------------------------------------------------------------------------------------------------------------------------------------------
    1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    ------------------------------------------------------------------------------------------------------------------------------------------

    Time: 186ms; Memory: 10MB

    Please check.
    Thank You.

  • 🇮🇳India nitin_lama India

    Patch #2 applies cleanly. No remaining errors/warnings.

  • Status changed to Needs review over 1 year ago
  • 🇮🇳India yashmalviya

    Hi @paraderojether

    I have checked the info.yml file in the module it looks clean . And run the phpcs command there are no errors or warning. I am providing a screenshot for the same. If you are running any other command for it can you please suggest which command are you running?

  • 🇮🇳India riddhi.addweb

    I applied the #2 Patch and it seems like still the phpcs errors are not resolved. These are the errors which are displayed:-

    FILE: /var/www/html/web/drupal10/web/modules/contrib/purge_invalidation_form/src/InvalidationManager.php
    -----------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    -----------------------------------------------------------------------------------------------------------------------------------------------
    16 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\StringTranslation\StringTranslationTrait.
    58 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter
    -----------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -----------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/web/drupal10/web/modules/contrib/purge_invalidation_form/src/Form/InvalidationForm.php
    --------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------------
    9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\purge_invalidation_form\InvalidationManager.
    --------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------------

    FILE: /var/www/html/web/drupal10/web/modules/contrib/purge_invalidation_form/purge_invalidation_form.info.yml
    -------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------
    1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
    1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
    -------------------------------------------------------------------------------------------------------------

  • Status changed to Needs work 5 months ago
Production build 0.71.5 2024