t() calls should be avoided in classes and #options values usually have to run through t() for translation.

Created on 25 February 2023, over 2 years ago

Problem/Motivation

FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/tablefield/tests/src/Functional/TableValueFieldTest.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/tablefield/src/Plugin/Field/FieldWidget/TablefieldWidget.php
----------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 2 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------------------------------------------------------
92 | WARNING | [ ] #options values usually have to run through t() for translation
93 | WARNING | [ ] #options values usually have to run through t() for translation
136 | ERROR | [x] Use null coalesce operator instead of ternary operator.
139 | ERROR | [x] Use null coalesce operator instead of ternary operator.
178 | ERROR | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/drupal_9.4/drupal/web/modules/contrib/tablefield/src/Element/Tablefield.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------
81 | ERROR | [x] Use null coalesce operator instead of ternary operator.
82 | ERROR | [x] Use null coalesce operator instead of ternary operator.
119 | ERROR | [x] Use null coalesce operator instead of ternary operator.
142 | ERROR | [ ] The array declaration extends to column 88 (the limit is 80). The array content should be split up over multiple lines
------------------------------------------------------------------------------------------------------------------------------------------

Time: 431ms; Memory: 14MB

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India Rohit Rana

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

Comments & Activities

Production build 0.71.5 2024