Problem/Motivation

After running coder for Drupal best practices, I found the following issues regarding t() calls:

FILE: /advancedqueue/src/Plugin/AdvancedQueue/Backend/BackendBase.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 104 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /advancedqueue/src/Form/QueueForm.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 123 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 124 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /advancedqueue/src/QueueListBuilder.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

Proposed resolution

Need to replace t() calls with $this->t() wherever required.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ankithashetty created an issue. See original summary.

ankithashetty’s picture

Status: Active » Needs review
FileSize
2 KB

Replaced t() calls with $this->t() wherever needed in the following patch, please review.

Thank you.

andypost’s picture

Fixed remains

jonathanshaw’s picture

Status: Needs review » Reviewed & tested by the community
jcnventura’s picture

Thanks for the patch!

  • andypost authored 4e4a05a on 8.x-1.x
    Issue #3156680 by andypost, ankithashetty, jonathanshaw, jcnventura:...
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.