Fix the issues reported by phpcs

Created on 26 June 2023, over 1 year ago
Updated 28 July 2023, over 1 year ago

Problem/Motivation

FILE: /Users/specbee/Sites/Projects/gmessage/src/Plugin/GroupContentEnabler/GroupMessageDeriver.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 22 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/gmessage/src/Plugin/Group/Relation/GroupMessage.php
---------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------------------------------------------------
 6 | WARNING | [x] Unused use statement
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------


FILE: /Users/specbee/Sites/Projects/gmessage/src/Plugin/Group/Relation/GroupMessageDeriver.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 2 WARNINGS AFFECTING 3 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
  9 | ERROR   | [x] Missing class doc comment
 24 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 25 | WARNING | [ ] t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------

Time: 107ms; Memory: 10MB

Steps to reproduce

Run following command
phpcs --standard=“Drupal,DrupalPractice” --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml .

📌 Task
Status

RTBC

Version

1.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @sonam_sharma
  • Issue was unassigned.
  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    The issue summary should always describe what should be fixed/changed. Neither the title nor screenshots are sufficient to describe what the issue is, even in the case a patch is provided.
    In the case of a bug, the description should also list the steps necessary to reproduce the issue, starting from when the module/theme is installed.

    Since those issues are reported by PHP_CodeSniffer, why does not this issue fix all the warnings/errors reported by PHP_CodeSniffer?

  • Assigned to imustakim
  • 🇮🇳India imustakim Ahmedabad

    Issue summary updated.
    Added coding standard tag to the issue.

  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India imustakim Ahmedabad

    Fixed all the coding standard issues.
    Patch updated and interdiff attached.
    Please review.

  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines roberttabigue

    Hi,

    I reviewed the changes and confirmed that Patch #6 was applied cleanly to the Group Message module against 1.0.x-dev on Drupal 9.5.10.

    Checking patch src/Plugin/Group/Relation/GroupMessage.php...
    Checking patch src/Plugin/Group/Relation/GroupMessageDeriver.php...
    Checking patch src/Plugin/GroupContentEnabler/GroupMessageDeriver.php...
    Applied patch src/Plugin/Group/Relation/GroupMessage.php cleanly.
    Applied patch src/Plugin/Group/Relation/GroupMessageDeriver.php cleanly.
    Applied patch src/Plugin/GroupContentEnabler/GroupMessageDeriver.php cleanly.

    And all PHPCS errors have been fixed.

    I ran this command on the module:
    phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml gmessage/

    Please see the attached files for reference.

    I'm moving this now to RTBC.

    Thank you!

Production build 0.71.5 2024