Fix code style issues

Created on 30 January 2023, almost 2 years ago

Problem/Motivation

phpcs gives warnings and errors when checking with Drupal and DrupalPractice standards.

$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,install,update .


FILE: /.../fieldblock/src/Form/FieldBlockConfigForm.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------------------------------------
 138 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
     |         | instead
 139 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t()
     |         | instead
----------------------------------------------------------------------------------------------------------------------------------


FILE: /.../fieldblock/src/Plugin/Block/FieldBlock.php
----------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
----------------------------------------------------------------------------------------------------------------------------------
  65 | ERROR | [x] Doc comment short description must end with a full stop
  78 | ERROR | [ ] Parameter $languageManager is not described in comment
 339 | ERROR | [ ] The array declaration extends to column 84 (the limit is 80). The array content should be split up over
     |       |     multiple lines
 340 | ERROR | [ ] The array declaration extends to column 96 (the limit is 80). The array content should be split up over
     |       |     multiple lines
 398 | ERROR | [x] Doc comment short description must end with a full stop
 400 | ERROR | [ ] Missing parameter comment
 402 | ERROR | [ ] Description for the @return value is missing
----------------------------------------------------------------------------------------------------------------------------------


FILE: /.../fieldblock/src/Controller/FieldBlockController.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 13 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------


FILE: /.../fieldblock/src/BlockEntityStorage.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 16 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
-----------------------------------------------------------------------------------------------------------------

Time: 213ms; Memory: 12MB
📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇳🇱Netherlands sutharsan

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

Comments & Activities

Production build 0.71.5 2024