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

Created on 30 May 2023, over 1 year ago
Updated 6 December 2023, 12 months ago

Problem/Motivation

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

Steps to reproduce

Run the command:

phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml plausible_tracking/

Proposed resolution

Fix the following coding standards issues and upload the patch or create an MR with fixes.

FILE: C:\xampp\htdocs\drupal_9\web\modules\contrib\plausible_tracking\src\Form\PlausibleConfigForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
160 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India arti_parmar

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

Comments & Activities

Production build 0.71.5 2024