PHPCS coding standard issues

Created on 5 August 2022, over 2 years ago
Updated 2 May 2024, 7 months ago

Need to resolve below issues.

FILE: /home/drupal/myproject/hide_revision_field/hide_revision_field.install
---------------------------------------------------------------------------------------------------------
FOUND 5 ERRORS AND 1 WARNING AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------
 13 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements
    |         |     hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "*
    |         |     Implements hook_foo_BAR_ID_bar() for block templates."
 21 | ERROR   | [x] There must be exactly one blank line before the tags in a doc comment
 23 | ERROR   | [ ] Description for the @return value is missing
 24 | ERROR   | [x] Separate the @return and @throws sections by a blank line.
 76 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 77 | ERROR   | [x] Use null coalesce operator instead of ternary operator.

FILE: /home/drupal/myproject/hide_revision_field/hide_revision_field.module
---------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 1 WARNING AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------
  28 | ERROR   | [ ] unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes
     |         |     option.
  31 | WARNING | [x] Inline @var declarations should use the /** */ delimiters
  55 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 138 | ERROR   | [x] There should be no white space after an opening "("

FILE: /home/drupal/myproject/hide_revision_field/src/Plugin/Field/FieldWidget/RevisionLogWidget.php
---------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
---------------------------------------------------------------------------------------------------------
  27 | ERROR   | Missing member variable doc comment
  96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 108 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 116 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 198 | WARNING | User::load calls should be avoided in classes, use dependency injection instead
 199 | ERROR   | unserialize() is insecure unless allowed classes are limited. Use a safe format like JSON or use the allowed_classes option.
--------------------------------------------------------------------------------------------------
📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇮🇳India Dharti Patel

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

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