Fix the issues reported by phpcs

Created on 28 October 2022, about 2 years ago
Updated 12 February 2024, 10 months ago

Problem/Motivation

FILE: ...cms/drupal9/web/modules/contrib/private_message/private_message.tokens.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 108 | ERROR | [x] Functions must not contain multiple empty lines in a row;
     |       |     found 2 empty lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ib/private_message/tests/src/Functional/PrivateMessageSettingsFormTest.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 73 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
    |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ..._cms/drupal9/web/modules/contrib/private_message/private_message.theme.inc
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------
 17 | ERROR | The array declaration extends to column 152 (the limit is 80).
    |       | The array content should be split up over multiple lines
 17 | ERROR | The array declaration extends to column 151 (the limit is 80).
    |       | The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: ...l/drupal_cms/drupal9/web/modules/contrib/private_message/js/history_api.js
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 41 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
 42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
 49 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
    |       |     found "false"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...9/web/modules/contrib/private_message/js/private_message_members_widget.js
--------------------------------------------------------------------------------
FOUND 12 ERRORS AFFECTING 12 LINES
--------------------------------------------------------------------------------
  27 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  28 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  29 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  96 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 109 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 112 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 116 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 173 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "NULL" but
     |       |     found "null"
 244 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 308 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 465 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 500 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...b/modules/contrib/private_message/js/private_message_notification_block.js
--------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
  24 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  26 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  77 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  84 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 102 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...pal9/web/modules/contrib/private_message/js/private_message_inbox_block.js
--------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 8 LINES
--------------------------------------------------------------------------------
  26 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  27 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  28 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  40 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  52 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 121 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 134 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 180 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 8 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...s/drupal9/web/modules/contrib/private_message/js/private_message_thread.js
--------------------------------------------------------------------------------
FOUND 11 ERRORS AFFECTING 11 LINES
--------------------------------------------------------------------------------
  32 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  33 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  34 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
  64 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
  85 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 164 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 183 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 228 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 245 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
     |       |     found "false"
 271 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
 359 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
     |       |     found "true"
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: .../web/modules/contrib/private_message/src/Service/PrivateMessageService.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 356 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
 366 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
 378 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ...odules/contrib/private_message/src/Service/PrivateMessageThreadManager.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 106 | WARNING | Unused private method addMessage()
 118 | WARNING | Unused private method sendNotification()
--------------------------------------------------------------------------------


FILE: ...rupal9/web/modules/contrib/private_message/src/Form/PrivateMessageForm.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
 180 | ERROR | [x] Functions must not contain multiple empty lines in a row;
     |       |     found 2 empty lines
 199 | ERROR | [x] Data types in @var tags need to be fully namespaced
 199 | ERROR | [x] Data types in @var tags need to be fully namespaced
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...s/contrib/private_message/src/Entity/Builder/PrivateMessageViewBuilder.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AND 1 WARNING AFFECTING 3 LINES
--------------------------------------------------------------------------------
  8 | WARNING | [x] Unused use statement
 28 | ERROR   | [ ] Parameter $entityType is not described in comment
 33 | ERROR   | [ ] Doc comment for parameter $entityTypeManager does not match
    |         |     actual variable name $entity_display_repository
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...rib/private_message/src/Entity/Builder/PrivateMessageThreadViewBuilder.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
   9 | WARNING | [x] Unused use statement
 127 | ERROR   | [ ] The array declaration extends to column 110 (the limit is
     |         |     80). The array content should be split up over multiple
     |         |     lines
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...l9/web/modules/contrib/private_message/src/Mapper/PrivateMessageMapper.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
 205 | WARNING | Code after the RETURN statement on line 198 cannot be executed
 227 | ERROR   | The array declaration extends to column 92 (the limit is 80).
     |         | The array content should be split up over multiple lines
--------------------------------------------------------------------------------


FILE: ...e/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMessageFormatter.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 316 | ERROR | [x] Use null coalesce operator instead of ternary operator.
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ge/src/Plugin/Field/FieldFormatter/PrivateMessageThreadMemberFormatter.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AND 1 WARNING AFFECTING 2 LINES
--------------------------------------------------------------------------------
 280 | ERROR   | The array declaration extends to column 160 (the limit is 80).
     |         | The array content should be split up over multiple lines
 309 | WARNING | Only string literals should be passed to t() where possible
--------------------------------------------------------------------------------


FILE: ...trib/private_message/src/PluginManager/PrivateMessageConfigFormManager.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 8 | ERROR | [x] Non-namespaced classes/interfaces/traits should not be
   |       |     referenced with use statements
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 1.23 secs; Memory: 18MB

Steps to reproduce

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

📌 Task
Status

Fixed

Version

3.0

Component

Code

Created by

🇮🇳India Rohit Rana

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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024