t() calls should be avoided in classes

Created on 7 July 2023, over 1 year ago
Updated 19 July 2024, 6 months ago

Problem/Motivation

PHPCS throws the error for t() calls - t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead in the LinkIframeFormatter.php file

Steps to reproduce

Run the phpcs command on the module.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

šŸ“Œ Task
Status

RTBC

Version

2.0

Component

Code

Created by

šŸ‡®šŸ‡³India sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @sidharth_soman
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore
  • Open in Jenkins ā†’ Open on Drupal.org ā†’
    Core: 9.5.5 + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    1 pass
  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore
  • Status changed to RTBC 6 months ago
  • Hi @sidharth_soman,

    The changes you made on MR!2 was applied successfully, and confirmed it fixed the reported errors.

    link_iframe_formatter git:(2.x) curl https://git.drupalcode.org/project/link_iframe_formatter/-/merge_requests/2.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  1650    0  1650    0     0   4277      0 --:--:-- --:--:-- --:--:--  4400
    patching file src/Plugin/Field/FieldFormatter/LinkIframeFormatter.php
    āžœ  link_iframe_formatter git:(2.x) āœ— cd ..
    āžœ  contrib git:(main) āœ— phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig link_iframe_formatter
    āžœ  contrib git:(main) āœ—

    Will now move this to RTBC

    Thanks,
    Jake

Production build 0.71.5 2024