Fix the issues reported by phpcs

Created on 16 February 2024, 4 months ago
Updated 5 March 2024, 4 months ago

Problem/Motivation

Module's code contains several Drupal Coding Standards issues.

FILE: ...l/web/modules/custom/packt/packthub_ebook_integration-3421803/packt.module
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  3 | ERROR | Missing short description in doc comment
  7 | ERROR | Doc comment is empty
 15 | ERROR | Doc comment is empty
 23 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------


FILE: .../custom/packt/packthub_ebook_integration-3421803/assets/css/advance_ss.css
--------------------------------------------------------------------------------
FOUND 149 ERRORS AFFECTING 149 LINES
--------------------------------------------------------------------------------
   4 | ERROR | Style definitions must end with a semicolon
  15 | ERROR | More than 2 empty lines are not allowed
  17 | ERROR | Style definitions must end with a semicolon
  26 | ERROR | Style definitions must end with a semicolon
  31 | ERROR | Style definitions must end with a semicolon
  37 | ERROR | Style definitions must end with a semicolon
  41 | ERROR | Style definitions must end with a semicolon
  47 | ERROR | Style definitions must end with a semicolon
  52 | ERROR | Style definitions must end with a semicolon
  57 | ERROR | Style definitions must end with a semicolon
  63 | ERROR | Style definitions must end with a semicolon
  68 | ERROR | Style definitions must end with a semicolon
  73 | ERROR | Style definitions must end with a semicolon
  80 | ERROR | Style definitions must end with a semicolon
  84 | ERROR | Style definitions must end with a semicolon
  89 | ERROR | Style definitions must end with a semicolon
  93 | ERROR | Style definitions must end with a semicolon
 101 | ERROR | Style definitions must end with a semicolon
 105 | ERROR | Style definitions must end with a semicolon
 109 | ERROR | Style definitions must end with a semicolon
 114 | ERROR | Style definitions must end with a semicolon
 119 | ERROR | Style definitions must end with a semicolon
 123 | ERROR | Style definitions must end with a semicolon
 127 | ERROR | Style definitions must end with a semicolon
 138 | ERROR | Style definitions must end with a semicolon
 143 | ERROR | Style definitions must end with a semicolon
 148 | ERROR | Style definitions must end with a semicolon
 155 | ERROR | Style definitions must end with a semicolon
 163 | ERROR | Style definitions must end with a semicolon
 170 | ERROR | Style definitions must end with a semicolon
 174 | ERROR | Style definitions must end with a semicolon
 183 | ERROR | Style definitions must end with a semicolon
 188 | ERROR | Style definitions must end with a semicolon
 192 | ERROR | Style definitions must end with a semicolon
 198 | ERROR | Style definitions must end with a semicolon
 203 | ERROR | Style definitions must end with a semicolon
 208 | ERROR | Style definitions must end with a semicolon
 213 | ERROR | Style definitions must end with a semicolon
 218 | ERROR | Style definitions must end with a semicolon
 223 | ERROR | Style definitions must end with a semicolon
 227 | ERROR | Style definitions must end with a semicolon
 231 | ERROR | Style definitions must end with a semicolon
 235 | ERROR | Style definitions must end with a semicolon
 239 | ERROR | Style definitions must end with a semicolon
 243 | ERROR | Style definitions must end with a semicolon
 255 | ERROR | Style definitions must end with a semicolon
 263 | ERROR | Style definitions must end with a semicolon
 269 | ERROR | Style definitions must end with a semicolon
 273 | ERROR | Style definitions must end with a semicolon
 277 | ERROR | Style definitions must end with a semicolon
 287 | ERROR | Style definitions must end with a semicolon
 291 | ERROR | Style definitions must end with a semicolon
 295 | ERROR | Style definitions must end with a semicolon
 299 | ERROR | Style definitions must end with a semicolon
 308 | ERROR | Style definitions must end with a semicolon
 324 | ERROR | Style definitions must end with a semicolon
 329 | ERROR | Style definitions must end with a semicolon
 333 | ERROR | Style definitions must end with a semicolon
 347 | ERROR | Style definitions must end with a semicolon
 352 | ERROR | Style definitions must end with a semicolon
 357 | ERROR | Style definitions must end with a semicolon
 364 | ERROR | Style definitions must end with a semicolon
 369 | ERROR | Style definitions must end with a semicolon
 386 | ERROR | Style definitions must end with a semicolon
 393 | ERROR | Style definitions must end with a semicolon
 406 | ERROR | Style definitions must end with a semicolon
 411 | ERROR | Style definitions must end with a semicolon
 415 | ERROR | Style definitions must end with a semicolon
 419 | ERROR | Style definitions must end with a semicolon
 425 | ERROR | Style definitions must end with a semicolon
 431 | ERROR | Style definitions must end with a semicolon
 436 | ERROR | Style definitions must end with a semicolon
 440 | ERROR | Style definitions must end with a semicolon
 444 | ERROR | Style definitions must end with a semicolon
 459 | ERROR | Style definitions must end with a semicolon
 463 | ERROR | Style definitions must end with a semicolon
 468 | ERROR | Style definitions must end with a semicolon
 473 | ERROR | Style definitions must end with a semicolon
 478 | ERROR | Style definitions must end with a semicolon
 493 | ERROR | Style definitions must end with a semicolon
 497 | ERROR | Style definitions must end with a semicolon
 501 | ERROR | Style definitions must end with a semicolon
 509 | ERROR | Style definitions must end with a semicolon
 517 | ERROR | Style definitions must end with a semicolon
 523 | ERROR | Style definitions must end with a semicolon
 527 | ERROR | Style definitions must end with a semicolon
 532 | ERROR | Style definitions must end with a semicolon
 542 | ERROR | Style definitions must end with a semicolon
 548 | ERROR | Style definitions must end with a semicolon
 553 | ERROR | Style definitions must end with a semicolon
 558 | ERROR | Style definitions must end with a semicolon
 562 | ERROR | Style definitions must end with a semicolon
 566 | ERROR | Style definitions must end with a semicolon
 570 | ERROR | Style definitions must end with a semicolon
 579 | ERROR | Style definitions must end with a semicolon
 587 | ERROR | Style definitions must end with a semicolon
 599 | ERROR | Style definitions must end with a semicolon
 603 | ERROR | Style definitions must end with a semicolon
 615 | ERROR | Style definitions must end with a semicolon
 619 | ERROR | Style definitions must end with a semicolon
 624 | ERROR | Style definitions must end with a semicolon
 628 | ERROR | Style definitions must end with a semicolon
 632 | ERROR | Style definitions must end with a semicolon
 638 | ERROR | Style definitions must end with a semicolon
 644 | ERROR | Style definitions must end with a semicolon
 648 | ERROR | Style definitions must end with a semicolon
 652 | ERROR | Style definitions must end with a semicolon
 666 | ERROR | Style definitions must end with a semicolon
 671 | ERROR | Style definitions must end with a semicolon
 676 | ERROR | Style definitions must end with a semicolon
 681 | ERROR | Style definitions must end with a semicolon
 687 | ERROR | Style definitions must end with a semicolon
 702 | ERROR | Style definitions must end with a semicolon
 706 | ERROR | Style definitions must end with a semicolon
 721 | ERROR | Style definitions must end with a semicolon
 725 | ERROR | Style definitions must end with a semicolon
 730 | ERROR | Style definitions must end with a semicolon
 734 | ERROR | Style definitions must end with a semicolon
 738 | ERROR | Style definitions must end with a semicolon
 752 | ERROR | Style definitions must end with a semicolon
 758 | ERROR | Style definitions must end with a semicolon
 775 | ERROR | Style definitions must end with a semicolon
 780 | ERROR | Style definitions must end with a semicolon
 787 | ERROR | Style definitions must end with a semicolon
 794 | ERROR | Style definitions must end with a semicolon
 804 | ERROR | Style definitions must end with a semicolon
 808 | ERROR | Style definitions must end with a semicolon
 812 | ERROR | Style definitions must end with a semicolon
 816 | ERROR | Style definitions must end with a semicolon
 820 | ERROR | Style definitions must end with a semicolon
 836 | ERROR | Style definitions must end with a semicolon
 846 | ERROR | Style definitions must end with a semicolon
 856 | ERROR | Style definitions must end with a semicolon
 865 | ERROR | Style definitions must end with a semicolon
 874 | ERROR | Style definitions must end with a semicolon
 878 | ERROR | Style definitions must end with a semicolon
 883 | ERROR | Style definitions must end with a semicolon
 888 | ERROR | Style definitions must end with a semicolon
 903 | ERROR | Style definitions must end with a semicolon
 917 | ERROR | Style definitions must end with a semicolon
 921 | ERROR | Style definitions must end with a semicolon
 925 | ERROR | Style definitions must end with a semicolon
 929 | ERROR | Style definitions must end with a semicolon
 933 | ERROR | Style definitions must end with a semicolon
 938 | ERROR | Style definitions must end with a semicolon
 944 | ERROR | Style definitions must end with a semicolon
 949 | ERROR | Style definitions must end with a semicolon
 953 | ERROR | Style definitions must end with a semicolon
 958 | ERROR | Style definitions must end with a semicolon
--------------------------------------------------------------------------------


FILE: ...kt/packthub_ebook_integration-3421803/src/Controller/ProductsDashboard.php
--------------------------------------------------------------------------------
FOUND 8 ERRORS AND 15 WARNINGS AFFECTING 23 LINES
--------------------------------------------------------------------------------
  22 | ERROR   | Doc comment is empty
  50 | ERROR   | Doc comment is empty
  61 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
  81 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
  83 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
  86 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
  88 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 111 | ERROR   | Doc comment is empty
 158 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 160 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 178 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 188 | ERROR   | Doc comment is empty
 235 | ERROR   | Doc comment is empty
 253 | ERROR   | Doc comment is empty
 267 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 281 | ERROR   | Doc comment is empty
 289 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 297 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 324 | WARNING | File::load calls should be avoided in classes, use dependency
     |         | injection instead
 329 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 338 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
 347 | ERROR   | Doc comment is empty
 351 | WARNING | \Drupal calls should be avoided in classes, use dependency
     |         | injection instead
--------------------------------------------------------------------------------


FILE: ...es/custom/packt/packthub_ebook_integration-3421803/src/Plugin/Products.php
--------------------------------------------------------------------------------
FOUND 27 ERRORS AND 2 WARNINGS AFFECTING 29 LINES
--------------------------------------------------------------------------------
   5 | ERROR   | Doc comment is empty
  10 | ERROR   | Missing member variable doc comment
  12 | ERROR   | Missing member variable doc comment
  14 | ERROR   | Missing member variable doc comment
  16 | ERROR   | Missing member variable doc comment
  18 | ERROR   | Missing member variable doc comment
  20 | ERROR   | Missing member variable doc comment
  22 | ERROR   | Doc comment is empty
  29 | ERROR   | Missing short description in doc comment
  31 | WARNING | Line exceeds 80 characters; contains 84 characters
  34 | WARNING | Line exceeds 80 characters; contains 87 characters
  37 | ERROR   | Description for the @return value is missing
  74 | ERROR   | Doc comment is empty
 129 | ERROR   | Missing short description in doc comment
 131 | ERROR   | Parameter comment must start with a capital letter
 133 | ERROR   | Description for the @return value is missing
 142 | ERROR   | Missing short description in doc comment
 144 | ERROR   | Parameter comment must start with a capital letter
 146 | ERROR   | Description for the @return value is missing
 152 | ERROR   | Missing short description in doc comment
 156 | ERROR   | Description for the @return value is missing
 162 | ERROR   | Doc comment is empty
 171 | ERROR   | Missing short description in doc comment
 176 | ERROR   | Missing parameter comment
 178 | ERROR   | Description for the @return value is missing
 183 | ERROR   | The array declaration extends to column 125 (the limit is
     |         | 120). The array content should be split up over multiple lines
 194 | ERROR   | Missing short description in doc comment
 198 | ERROR   | Description for the @return value is missing
 200 | ERROR   | Public method name "Products::setProductID" is not in
     |         | lowerCamel format
--------------------------------------------------------------------------------


FILE: ...om/packt/packthub_ebook_integration-3421803/src/Plugin/EbookDefinition.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
 10 | ERROR | Doc comment is empty
 17 | ERROR | Doc comment is empty
 36 | ERROR | Doc comment is empty
 73 | ERROR | Doc comment is empty
--------------------------------------------------------------------------------


FILE: ...packt/packthub_ebook_integration-3421803/src/Plugin/EbookNodeProcessor.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AND 1 WARNING AFFECTING 10 LINES
--------------------------------------------------------------------------------
  11 | ERROR   | Doc comment is empty
  15 | ERROR   | Missing member variable doc comment
  17 | ERROR   | Doc comment is empty
  24 | ERROR   | Missing member variable doc comment
  26 | ERROR   | Doc comment is empty
  38 | ERROR   | Doc comment is empty
 113 | ERROR   | Doc comment is empty
 120 | WARNING | Unused variable $key.
 185 | ERROR   | Doc comment is empty
 199 | ERROR   | Doc comment is empty
--------------------------------------------------------------------------------


FILE: ...tom/packt/packthub_ebook_integration-3421803/src/Plugin/ProductsAssets.php
--------------------------------------------------------------------------------
FOUND 11 ERRORS AND 1 WARNING AFFECTING 11 LINES
--------------------------------------------------------------------------------
  5 | ERROR   | Doc comment is empty
  9 | ERROR   | Missing member variable doc comment
 11 | ERROR   | Class property $file_name should use lowerCamel naming without
    |         | underscores
 11 | ERROR   | Missing member variable doc comment
 13 | ERROR   | Doc comment is empty
 20 | ERROR   | Missing short description in doc comment
 24 | ERROR   | Description for the @return value is missing
 30 | ERROR   | Missing short description in doc comment
 32 | WARNING | Line exceeds 80 characters; contains 92 characters
 34 | ERROR   | Description for the @return value is missing
 40 | ERROR   | Missing short description in doc comment
 45 | ERROR   | Description for the @return value is missing
--------------------------------------------------------------------------------


FILE: ...packt/packthub_ebook_integration-3421803/src/Form/EbookContentTypeForm.php
--------------------------------------------------------------------------------
FOUND 6 ERRORS AND 4 WARNINGS AFFECTING 10 LINES
--------------------------------------------------------------------------------
  12 | ERROR   | Doc comment is empty
  17 | ERROR   | Parameter $messenger is not described in comment
  38 | ERROR   | Doc comment is empty
  45 | ERROR   | Doc comment is empty
  59 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
  61 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
  85 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
  91 | ERROR   | Doc comment is empty
 118 | ERROR   | Doc comment is empty
 137 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait and
     |         | $this->t() instead
--------------------------------------------------------------------------------


FILE: ...les/custom/packt/packthub_ebook_integration-3421803/src/Form/PacktForm.php
--------------------------------------------------------------------------------
FOUND 9 ERRORS AFFECTING 6 LINES
--------------------------------------------------------------------------------
 11 | ERROR | Doc comment is empty
 23 | ERROR | Missing short description in doc comment
 28 | ERROR | Parameter $messenger is not described in comment
 50 | ERROR | Doc comment short description must start with a capital letter
 50 | ERROR | Doc comment short description must end with a full stop
 57 | ERROR | Doc comment short description must start with a capital letter
 57 | ERROR | Doc comment short description must end with a full stop
 74 | ERROR | Doc comment short description must start with a capital letter
 74 | ERROR | Doc comment short description must end with a full stop
--------------------------------------------------------------------------------

Time: 187ms; Memory: 10MB

Steps to reproduce

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

Proposed resolution

Fix remaining errors/ warnings as per Drupal coding standards.

๐Ÿ“Œ Task
Status

Needs review

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Mohd Sahzad

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

Production build 0.69.0 2024