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
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | patch-do_username.png | 20.79 KB | Varun Rao |
| #2 | 3166024-2.patch | 3.16 KB | ankithashetty |
Comments
Comment #2
ankithashettyIn the following patch replaced
t()calls with$this->t()wherever needed, please review.Thank you.
Comment #3
Varun Rao commentedPatch #2 applied successfully.
Looks good to me.
Comment #4
hussainwebI just tested this manually and it's working well. Thanks for the patch.
Comment #6
hussainweb