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

Created on 21 June 2023, over 1 year ago
Updated 22 June 2023, over 1 year ago

FILE: D:\xampp\htdocs\drupal_10\web\modules\contrib\omnisend\src\OmnisendApi.php
------------------------------------------------------------------------------------------------------------------------------------------
225 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------

📌 Task
Status

Closed: duplicate

Version

1.1

Component

Code

Created by

🇮🇳India arti_parmar

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

Comments & Activities

  • Issue created by @arti_parmar
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • 🇮🇳India arti_parmar

    Kindly review patch.

  • Status changed to RTBC over 1 year ago
  • 🇵🇭Philippines paraderojether

    Hi I reviewed patch #2, applied it against Omnisend 1.1.0, and confirmed the issue is fixed.

    I added screenshot for reference.
    Thank You.

  • Status changed to Needs work over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹
    class OmnisendApi
    -{
    +{   

    That is an off-topic change for an issue that aims to remove the calls to t() from classes code. It is also wrong, since the curly parenthesis is placed on the same line containing the class name, in Drupal.

    I am also curious on why the issue decided to fix a single line, out of all the possible errors/warnings given by PHP_CodeSniffer.

  • Status changed to Closed: duplicate over 1 year ago
  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    Furthermore, the report given in 🐛 Fix the issues reported by phpcs Needs review already contains warnings/errors about using t() in classes.

Production build 0.71.5 2024