Problem/Motivation

$ phpcs --standard=DrupalPractice .

FILE: /do_username/src/Plugin/Field/FieldType/DrupalOrgUsernameItem.php
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------
 131 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 134 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
------------------------------------------------------------------------------------------------------------------------------------------


FILE: /do_username/src/Plugin/Field/FieldWidget/DrupalOrgUsernameWidget.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------------------------------------------
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 50 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 70 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
 73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
-----------------------------------------------------------------------------------------------------------------------------------------

User interface changes

NONE

API changes

NONE

Data model changes

NONE

CommentFileSizeAuthor
#3 patch-do_username.png20.79 KBVarun Rao
#2 3166024-2.patch3.16 KBankithashetty

Comments

ankithashetty created an issue. See original summary.

ankithashetty’s picture

Status: Active » Needs review
StatusFileSize
new3.16 KB

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

Thank you.

Varun Rao’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new20.79 KB

Patch #2 applied successfully.
Looks good to me.

do

hussainweb’s picture

I just tested this manually and it's working well. Thanks for the patch.

  • hussainweb committed 9f26d49 on 8.x-1.x
    Issue #3166024 by ankithashetty, hussainweb: Avoid t() calls, instead...
hussainweb’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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