t() calls should be avoided in classes

Created on 28 June 2023, over 1 year ago
Updated 10 July 2023, over 1 year ago

Problem/Motivation

t() calls should be avoided in classes, use $this->t() instead

FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------
19 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
20 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
27 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
28 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-------------------------------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\know-how\modules\custom\activities\src\Plugin\views\field\DescriptionField.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
86 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-------------------------------------------------------------------------------------------------------------------------------
FILE: D:\xampp\htdocs\know-how\modules\custom\activities\src\Plugin\views\field\EventLinkField.php

FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE

42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead

FILE: D:\xampp\htdocs\know-how\modules\custom\activities\src\Plugin\views\field\RelatedEntityLinkField.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------
74 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead

Steps to reproduce:

Need to replace the t() wherever found in the code in the module.

๐Ÿ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Prachi6824

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

Comments & Activities

Production build 0.71.5 2024