Fix the issues reported by phpcs

Created on 24 February 2023, over 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/group_action/src/Plugin/Action/GroupActionBase.php
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
147 | ERROR | [x] Comments may not appear after statements
148 | ERROR | [x] Comments may not appear after statements
149 | ERROR | [x] Comments may not appear after statements
150 | ERROR | [x] Comments may not appear after statements
151 | ERROR | [x] Comments may not appear after statements
152 | ERROR | [x] No space found before comment text; expected "// 'add_method' => '', // Only relevant for "create" operation." but found "//'add_method' => '', //
| | Only relevant for "create" operation."
327 | WARNING | [ ] Role::load calls should be avoided in classes, use dependency injection instead
563 | ERROR | [x] Missing function doc comment
566 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
576 | ERROR | [ ] Missing short description in doc comment
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/group_action/src/Plugin/Action/GroupRemoveContent.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
15 | WARNING | [x] '@TODO, support multiple entity types once core is fixed.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/group_action/src/Plugin/Action/GroupUpdateContent.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
15 | WARNING | [x] '@TODO, support multiple entity types once core is fixed.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/group_action/src/Plugin/Action/GroupAddContent.php
-----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------
15 | WARNING | [x] '@TODO, support multiple entity types once core is fixed.' should match the format '@todo Fix problem X here.'
-----------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/group_action/src/Compatibility.php
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
91 | ERROR | [x] The static declaration must come after the visibility declaration
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

Time: 1.24 secs; Memory: 8MB

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/group_action/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

RTBC

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.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024