Problem/Motivation

When attempting to unit test a widget which extends the StringTextfieldWidget the traditional method of mocking the string translation service fails and an error is produced Call to undefined function Drupal\Core\Field\Plugin\Field\FieldWidget\t().

On further inspection many of the plugins extending PluginBase do not utilize $this when calling t().

Steps to reproduce

1. Extend StringTextfieldWidget
1. Override settingsForm by adding to what parent produces
1. Unit test new class

Proposed resolution

PluginBase is using StringTranslationTrait but many of the child plugins are not utilizing it properly. Use $this->t() instead of t() for string translation calls for all classes extending PluginBase.

Enable phpcs rule, "DrupalPractice.Objects.GlobalFunction" for the pattern */Plugin/*.

<rule ref="DrupalPractice.Objects.GlobalFunction">
  <include-pattern>*/Plugin/*</include-pattern>
</rule>

Remaining tasks

Reviews
Keeping the patch up to date

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

CommentFileSizeAuthor
#114 3181778-114-9.5.x.patch222.16 KBquietone
#114 interdiff-111-114-9.5.x.txt705 bytesquietone
#113 3181778-113-10.1.x.patch211.18 KBquietone
#113 interdiff-110-113-10.1.x.txt705 bytesquietone
#111 3181778-111-9.5.x.patch222.07 KBquietone
#111 diff-101-111-9.5.x.txt3.51 KBquietone
#110 3181778-110-10.1.x.patch211.1 KBquietone
#110 interdiff-105-110-10.1.txt3.24 KBquietone
#109 results-109.txt168.13 KBbbrala
#105 3181778-105-10.1.x.patch214.18 KBquietone
#105 diff-101-105-10.1.x.txt468 bytesquietone
#105 3181778-105-9.5.x.patch221.93 KBquietone
#105 diff-101-105-9.5.x.txt468 bytesquietone
#101 3181778-101-10.1.x.patch214.13 KBquietone
#101 diff-97-101-10.1.x.txt15.17 KBquietone
#101 3181778-101-9.5.x.patch221.88 KBquietone
#101 diff-97-101-9.5.x.txt1.79 KBquietone
#97 interdiff_91-97.txt1.97 KBRatan Priya
#97 3181778-97.patch223.15 KBRatan Priya
#91 interdiff_88-91.txt1.07 KBaldairsoares
#91 3181778-91.patch223.33 KBaldairsoares
#88 3181778-88.patch223.22 KBaldairsoares
#88 interdiff_81-88.txt4.3 KBaldairsoares
#81 interdiff_72-81.txt21.11 KBaldairsoares
#81 3181778-81.patch223.66 KBaldairsoares
#79 interdiff_72-78..txt189.54 KBaldairsoares
#78 interdiff_72-78..txt63 bytesaldairsoares
#78 this_t_warnings.txt14.56 KBaldairsoares
#78 3181778-78.patch392.63 KBaldairsoares
#74 replace_t.png298.75 KBaldairsoares
#72 interdiff_70-72.txt7.59 KBrakesh.regar
#72 3181778-72.patch199.46 KBrakesh.regar
#71 3181778-70.patch201.61 KBAline Teixeira Ramos
#69 3181778-69.patch201.96 KBAline Teixeira Ramos
#35 interdiff-35.txt1.76 KBkapilv
#35 3181778-35.patch188.17 KBkapilv
#34 interdiff_33.txt11.49 KBkapilv
#34 3181778-33.patch188.17 KBkapilv
#31 interdiff.3181778.29-31.txt3.05 KBlongwave
#31 3181778-31.patch187.95 KBlongwave
#29 interdiff.3181778.27-29.txt1.3 KBlongwave
#29 3181778-29.patch187.91 KBlongwave
#27 3181778-27.patch187.69 KBanushrikumari
#23 interdiff_18-22.txt784 bytesanushrikumari
#22 3181778-22.patch186.17 KBanushrikumari
#18 interdiff-3181778-17-18.txt3.79 KBGrumpySchlag
#18 3181778-18.patch185.93 KBGrumpySchlag
#17 interdiff_15-17.txt1.72 KBraman.b
#17 3181778-17.patch185.54 KBraman.b
#15 interdiff_13-15.txt1.34 KBraman.b
#15 3181778-15.patch184.7 KBraman.b
#13 interdiff.3181778.11-13.txt23.16 KBlongwave
#13 3181778-13.patch183.97 KBlongwave
#11 interdiff.3181778.10-11.txt4.51 KBlongwave
#11 3181778-11.patch179.88 KBlongwave
#10 3181778-10.patch177.37 KBcchiste
#9 3181778-9.patch179.37 KBlongwave
#3 3181778-1.patch14.78 KBcchiste

Issue fork drupal-3181778

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

CChiste created an issue. See original summary.

cchiste’s picture

Title: StringTextfieldWidget not using $this->t() » Many FieldWidgets not using $this->t()
Issue summary: View changes
cchiste’s picture

StatusFileSize
new14.78 KB

This patch swaps t() for $this->t() for the following widgets:
- BooleanCheckboxWidget
- EmailDefaultWidget
- EntityReferenceAutocompleteWidget
- NumberWidget
- OptionsButtonsWidget
- OptionsSelectWidget
- OptionsWidgetBase
- StringTextareaWidget
- StringTextfieldWidget

In addition to using new TranslatableMarkup() for the static OptionsWidgetBase::validateElement().

cchiste’s picture

Status: Active » Needs review
longwave’s picture

Title: Many FieldWidgets not using $this->t() » Replace t() with $this->t() in FieldWidget plugins
Version: 9.0.x-dev » 9.2.x-dev
Status: Needs review » Needs work
Parent issue: » #3113904: [META] Replace t() calls inside of classes

Replacing t() is an enormous task and scoping it effectively is tricky, but maybe grouping by plugin type is a good way of doing this.

However, there are many more FieldWidgets that need fixing up if we are to cover them all here, including:

./core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
./core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php
./core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php
./core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php
./core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
./core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
./core/modules/link/src/Plugin/Field/FieldWidget/LinkWidget.php
./core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
./core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php
./core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php
./core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php

longwave’s picture

Category: Bug report » Task

While this causes problems with unit testing it isn't strictly a bug, so reclassifying as a task.

And I should have said earlier: thanks for working on this :)

longwave’s picture

In fact, as Drupal\Core\Plugin\PluginBase includes StringTranslationTrait, I wonder if we should rescope this to cover all Field plugins or even *all* plugins that extend from PluginBase?

cchiste’s picture

Issue summary: View changes
longwave’s picture

Title: Replace t() with $this->t() in FieldWidget plugins » Replace t() with $this->t() in all plugins
Status: Needs work » Needs review
StatusFileSize
new179.37 KB

Tried to automate this with:

find . -name '*.php'|grep -E '/(src|Field)/Plugin/'|xargs sed -i -E 's/ t\(/ $this->t(/g'

Unsure if I missed any, let's see how this goes.

cchiste’s picture

StatusFileSize
new177.37 KB

Great, thanks for that! I did find some D6/7 migration items (Derivers) that are not derivatives of class' using the StringTranslationTrait in the patch and have removed.

longwave’s picture

StatusFileSize
new179.88 KB
new4.51 KB

Thanks! Rerolled as #10 didn't apply, and a few more fixes, hopefully the tests will complete now - I don't expect them all to pass but fingers crossed.

Status: Needs review » Needs work

The last submitted patch, 11: 3181778-11.patch, failed testing. View results

longwave’s picture

Assigned: cchiste » Unassigned
Status: Needs work » Needs review
StatusFileSize
new183.97 KB
new23.16 KB

Converted calls in static methods to new TranslatableMarkup() as we can't use $this in that context.

Also removed some comments which didn't make sense any more:

  public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    // This is called very early by the user entity roles field. Prevent
    // early t() calls by using the TranslatableMarkup.

t() just calls new TranslatableMarkup anyway, so not sure what this is getting at, I think this must date to older code when t() returned translated strings directly.

Status: Needs review » Needs work

The last submitted patch, 13: 3181778-13.patch, failed testing. View results

raman.b’s picture

Status: Needs work » Needs review
StatusFileSize
new184.7 KB
new1.34 KB

Addressing the remaining failures

Status: Needs review » Needs work

The last submitted patch, 15: 3181778-15.patch, failed testing. View results

raman.b’s picture

Status: Needs work » Needs review
StatusFileSize
new185.54 KB
new1.72 KB

A couple of more instances..

GrumpySchlag’s picture

StatusFileSize
new185.93 KB
new3.79 KB

I review the patch #17 and found a new missing change on the class Drupal\views\Plugin\views\field\FieldPluginBase.
I run the command from #9 to found the new changes on FieldPluginBase.

Here is my changes and the interdiff.

PS: This is my first contribution to Drupal, I hope I didn't make too much mistake on my first patch.
Many thanks for your review

Status: Needs review » Needs work

The last submitted patch, 18: 3181778-18.patch, failed testing. View results

longwave’s picture

Thanks for the patch, and welcome to the core issue queue!

+++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
@@ -1820,7 +1820,7 @@ public static function trimText($alter, $value) {
-        $value .= t('…');
+        $value .= $this->t('…');

The tests failed because this is in a static method, and we can't use $this in static context. Here we have to replace the call to t() with new TranslatableMarkup() instead.

anushrikumari’s picture

Assigned: Unassigned » anushrikumari
anushrikumari’s picture

Assigned: anushrikumari » Unassigned
Status: Needs work » Needs review
StatusFileSize
new186.17 KB

Implemented the changes suggested in #20 by @longwave

anushrikumari’s picture

StatusFileSize
new784 bytes
longwave’s picture

Issue tags: +Needs reroll

Needs a reroll.

longwave’s picture

Status: Needs review » Needs work
anushrikumari’s picture

Assigned: Unassigned » anushrikumari
anushrikumari’s picture

Assigned: anushrikumari » Unassigned
Status: Needs work » Needs review
StatusFileSize
new187.69 KB

rerolled the patch for 9.2.x

nishantghetiya’s picture

Status: Needs review » Reviewed & tested by the community

I applied #27 on drupal core 9.2.x and it applied successfully. I didn't find any other place where t() need to be replace in plugins.

longwave’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: -Needs reroll
StatusFileSize
new187.91 KB
new1.3 KB

#27 fails a number of tests because $this is used in static context.

Status: Needs review » Needs work

The last submitted patch, 29: 3181778-29.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new187.95 KB
new3.05 KB
renatog’s picture

Status: Needs review » Needs work

This patch contains long lines.

In this case for example. Please could you split this array into a second line? E.g.:

Line 62
From:

'maxMessage' => $this->t('%name: the email address can not be longer than @max characters.', ['%name' => $this->getFieldDefinition()->getLabel(), '@max' => Email::EMAIL_MAX_LENGTH]),

To:

'maxMessage' => $this->t('%name: the email address can not be longer than @max characters.', [
  '%name' => $this->getFieldDefinition()->getLabel(),
  '@max' => Email::EMAIL_MAX_LENGTH
]),

Line 101.
From:
'maxMessage' => $this->t('%name: the value may be no greater than %max.', ['%name' => $label, '%max' => $max]),

To:

'maxMessage' => $this->t('%name: the value may be no greater than %max.', [
  '%name' => $label,
  '%max' => $max
]),

And last but not least, array with many options. E.g.:

Line 99
From:
'#options' => ['MDY' => $this->t('Month/Day/Year'), 'DMY' => $this->t('Day/Month/Year'), 'YMD' => $this->t('Year/Month/Day')],

To:

'#options' => [
  'MDY' => $this->t('Month/Day/Year'),
  'DMY' => $this->t('Day/Month/Year'),
  'YMD' => $this->t('Year/Month/Day')
],

Is clear and easier to read the code

kapilv’s picture

Assigned: Unassigned » kapilv
kapilv’s picture

Assigned: kapilv » Unassigned
Status: Needs work » Needs review
StatusFileSize
new188.17 KB
new11.49 KB

Addressed #32

kapilv’s picture

StatusFileSize
new188.17 KB
new1.76 KB

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mallezie made their first commit to this issue’s fork.

mallezie’s picture

Rerolled patch to 9.3.x.

Also reviewed the patch, and looks good to me. No unrelated changes, all changes look correct, and tests succeed.

vikashsoni’s picture

Patch working fine all changes looking good there is not issue after the patch
Thanks for the patch
Drupal version ---- 9.3.x.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

I'm marking this RTBC based on the above two comments.

larowlan’s picture

This is great cleanup. Is there a way we can prevent these creeping back in with a phpcs rule?

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Since #3151118: Include bootstrap.inc using composer this is less pressing. t() is present during unit tests now - we should have done that ages ago.

That said there's no harm in proceeding here but I think we should do this by trying to enable the existing PHPCS check for this. There is one - \DrupalPractice\Sniffs\Objects\GlobalFunctionSniff - I wonder how many of the other functions in are still existing - not too many as far as I can see - so this might work.

There are some out-of-scope changes and a question about whether or not we we translate test code.

Also I think we should try to do this during a beta release as this change affects many files and could disrupt other changes.

mauryarahul11 made their first commit to this issue’s fork.

mauryarahul11’s picture

Status: Needs work » Needs review

yogeshmpawar made their first commit to this issue’s fork.

vicheldt’s picture

Assigned: Unassigned » vicheldt

I will do the review of this issue.

vicheldt’s picture

Status: Needs review » Needs work

There's still 2 files inside Drupal\Core\Field\Plugin\ that have t() instead of $this->t().

vicheldt’s picture

Assigned: vicheldt » Unassigned
Status: Needs work » Needs review

I changed the other 2 files that were using t() instead $this->t().

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues

I'll do the review

beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
Status: Needs review » Reviewed & tested by the community

Reviewed. Looks good to me!

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Merge request 1326 doesn't contain all the changes, I am not sure why this was opened separately and think this should be closed.

Merge request 1185 still has outstanding comments from @alexpott.

beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues

I will apply the comments from @alexpott at MR 1185

beatrizrodrigues’s picture

Oh, I messed up the MR, I did the rebase from 9.4.x and not from the 9.3.x. Is there a way to change the merge target branch or do I have to open another MR? Sorry for the mess.

longwave’s picture

Only the person who created the MR can change the target branch. If that wasn't you, then open a new MR I guess?

beatrizrodrigues’s picture

@longwave thank you. I will do it.

beatrizrodrigues’s picture

Status: Needs work » Needs review
jonas-gerosa361’s picture

Reviewed MR !1680, looks good to me.

longwave’s picture

Status: Needs review » Needs work

Lots of test failures here.

libbna’s picture

hey @beatrizrodrigues are you still working on this issue? If not, I would like to work on this.

cchiste’s picture

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Aline Teixeira Ramos’s picture

Hey, i can work on it! =)

Aline Teixeira Ramos’s picture

I applyed the changes from MR 1680 and created a new MR against the 9.5.x branch. Lets wait for the tests.

Aline Teixeira Ramos’s picture

Assigned: Aline Teixeira Ramos » Unassigned
Status: Needs work » Needs review
StatusFileSize
new201.96 KB

Hi guys. I made the necessary changes according to what is asked in the problem. After the changes, I didn't identify any errors related to the topic (change t() to $this->t() or new TranslatableMarkup). =)

Aline Teixeira Ramos’s picture

Assigned: Unassigned » Aline Teixeira Ramos
Status: Needs review » Needs work
Aline Teixeira Ramos’s picture

Assigned: Aline Teixeira Ramos » Unassigned
Status: Needs work » Needs review
StatusFileSize
new201.61 KB

Resubmitting with phpcbf corrections from comment #69.

rakesh.regar’s picture

StatusFileSize
new199.46 KB
new7.59 KB

Tried applying patch #70 but getting PHP fatal error
fixed some things that made it working on 9.5.x with php8.1 & php7.4

aldairsoares’s picture

Assigned: Unassigned » aldairsoares

The last patch from @rakesh.regar passed the tests, thus I am going to review it.

aldairsoares’s picture

Assigned: aldairsoares » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new298.75 KB

I applied the last patch at #72 comment and run phpcs to look for any mistake.

There is no phpcs erros and the task asked in this issue (use $this->t() instead of t()) is completed.

I left a screenshot to show the changes in one of the files, making a comparison with the patch.

I'm moving it to RTBC.

alexpott’s picture

@aldairsoares thank you for looking into this issue.

Posting screenshots of your codebase or command-line interface does not advance the issue, since the automated testing infrastructure tells us whether the change set still applies correctly.

So, I've removed the issue credit for that screenshot. In the future, you can get credit for issues by reading the issue to understand its purpose, and posting your review or testing of that purpose. Thank you!

See the issue credit guidelines for more information.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We should add

  <rule ref="DrupalPractice.Objects.GlobalFunction">
    <include-pattern>*/Plugin/*</include-pattern>
  </rule>

To the DrupalPractice section of core/phpcs.xml.dist and fix all the other warnings that that generates. Some like the one in tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php are kinda a false positive but that could be new TranslatableMarkup() for cleaner code anyway. Others like core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php prove that we need to use PHPCS to do this :)

aldairsoares’s picture

Assigned: Unassigned » aldairsoares

Hi, @alexpott

I got it. My real intention here is to learn how things work in Drupal(I have just started to learn it) and give my little contribution. Credit is good but my main goal is purely to learn more about it.

I took the screenshot just to show that the last patch applied works. But no problem.

I am going to work on your last comment and trying to fix what you pointed.

Thanks.

aldairsoares’s picture

Status: Needs work » Needs review
StatusFileSize
new392.63 KB
new14.56 KB
new63 bytes

As @alexpott asked at #76, I added the code bellow at

core/phpcs.xml.dist

 <rule ref="DrupalPractice.Objects.GlobalFunction">
    <include-pattern>*/Plugin/*</include-pattern>
  </rule>

And used composer run phpcs -- -ps core command to find all warnings generated.

The following warnings appeared after that:

FILE: ...re/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 77 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 681 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...sql_count_cache_test/src/Plugin/migrate/source/SqlCountCache.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 21 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/views/src/Plugin/views/filter/InOperator.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 75 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/views/src/Plugin/views/field/Boolean.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
----------------------------------------------------------------------
 52 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 53 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 54 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 55 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 60 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/views/src/Plugin/views/area/View.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 121 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...dules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 72 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 73 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...p/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 366 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 367 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 302 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...ules/aggregator/src/Plugin/aggregator/fetcher/DefaultFetcher.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 130 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...odules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 37 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 92 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 92 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...ernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 29 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: .../Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 43 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
----------------------------------------------------------------------
 166 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 169 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 173 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 176 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 180 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 184 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 195 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 117 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 118 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: /app/core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------
 109 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 113 | WARNING | t() calls should be avoided in classes, use
     |         | \Drupal\Core\StringTranslation\StringTranslationTrait
     |         | and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...ib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/Broken.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 24 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------


FILE: ...Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 54 | WARNING | t() calls should be avoided in classes, use
    |         | \Drupal\Core\StringTranslation\StringTranslationTrait
    |         | and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
----------------------------------------------------------------------

Time: 3 mins, 38.03 secs; Memory: 228MB

So, I worked on fixing them.

PHPCS and the task asked on this issue are solved.

I attached a .txt file with all those warnings.

Needs review.

aldairsoares’s picture

StatusFileSize
new189.54 KB

Sending the correct interdiff file. The last one was empty.

aldairsoares’s picture

Assigned: aldairsoares » Unassigned

I forgot to unassign.

Needs review.

aldairsoares’s picture

StatusFileSize
new223.66 KB
new21.11 KB

The last patch had composer in it.

So, I am sending the corrected one.

Needs review.

The last submitted patch, 78: 3181778-78.patch, failed testing. View results

alexpott’s picture

Status: Needs review » Needs work

@aldairsoares can you add the changes to phpcs.xml.dist so we're permanently checking this. That way we'll not introduce any regressions and fixing everything else will become simpler.

alexpott’s picture

  1. +++ b/core/modules/views/tests/src/Functional/Plugin/DisplayTest.php
    @@ -363,8 +365,8 @@ public function testMissingRelationship() {
    -    $this->assertEquals(t('The %handler_type %handler uses a relationship that has been removed.', ['%handler_type' => 'field', '%handler' => 'User: Last login']), $errors['default'][0]);
    -    $this->assertEquals(t('The %handler_type %handler uses a relationship that has been removed.', ['%handler_type' => 'field', '%handler' => 'User: Created']), $errors['default'][1]);
    +    $this->assertEquals($this->t('The %handler_type %handler uses a relationship that has been removed.', ['%handler_type' => 'field', '%handler' => 'User: Last login']), $errors['default'][0]);
    +    $this->assertEquals($this->t('The %handler_type %handler uses a relationship that has been removed.', ['%handler_type' => 'field', '%handler' => 'User: Created']), $errors['default'][1]);
    

    This is a test assertion. I think here we should remove the use of t() altogether and hard code the expected string.

  2. +++ b/core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php
    @@ -12,6 +13,7 @@
    +  use StringTranslationTrait;
     
       /**
        * Modules to enable.
    @@ -69,8 +71,8 @@ protected function schemaDefinition() {
    
    @@ -69,8 +71,8 @@ protected function schemaDefinition() {
       protected function viewsData() {
         $data = parent::viewsData();
         $data['views_test_data']['uid'] = [
    -      'title' => t('UID'),
    -      'help' => t('The test data UID'),
    +      'title' => $this->t('UID'),
    +      'help' => $this->t('The test data UID'),
    
    +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
    @@ -10,6 +11,7 @@
     class AnnotatedClassDiscoveryTest extends DiscoveryTestBase {
    +  use StringTranslationTrait;
     
       protected function setUp(): void {
         parent::setUp();
    @@ -26,7 +28,7 @@ protected function setUp(): void {
    
    @@ -26,7 +28,7 @@ protected function setUp(): void {
             'label' => 'Banana',
             'color' => 'yellow',
             'uses' => [
    -          'bread' => t('Banana bread'),
    +          'bread' => $this->t('Banana bread'),
               'loaf' => [
                 'singular' => '@count loaf',
    
    +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
    @@ -11,6 +12,7 @@
     class CustomDirectoryAnnotatedClassDiscoveryTest extends DiscoveryTestBase {
    +  use StringTranslationTrait;
     
       protected function setUp(): void {
         parent::setUp();
    @@ -40,7 +42,7 @@ protected function setUp(): void {
    
    @@ -40,7 +42,7 @@ protected function setUp(): void {
             'label' => 'Banana',
             'color' => 'yellow',
             'uses' => [
    -          'bread' => t('Banana bread'),
    +          'bread' => $this->t('Banana bread'),
    

    This is a test - don't use the trait - use new TranslatableMarkup()

immaculatexavier’s picture

Assigned: Unassigned » immaculatexavier
immaculatexavier’s picture

Assigned: immaculatexavier » Unassigned
aldairsoares’s picture

Assigned: Unassigned » aldairsoares

I'm going to work on it.

aldairsoares’s picture

Assigned: aldairsoares » Unassigned
Status: Needs work » Needs review
StatusFileSize
new4.3 KB
new223.22 KB

@alexpott,

I made the changes you required at comments #83, #84.1 and #84.2

Needs review.

Status: Needs review » Needs work

The last submitted patch, 88: 3181778-88.patch, failed testing. View results

aldairsoares’s picture

Assigned: Unassigned » aldairsoares

One test failed. I'm going to work on it.

aldairsoares’s picture

Assigned: aldairsoares » Unassigned
Status: Needs work » Needs review
StatusFileSize
new223.33 KB
new1.07 KB

I'm sending a new patch with a correction at DisplayTest.php file.

path: core/modules/views/tests/src/Functional/Plugin/DisplayTest.php

I changed the lines #366 and #367 from:

$this->assertEquals($this->t('The %handler_type %handler uses a relationship that has been removed.', ['%handler_type' => 'field', '%handler' => 'User: Last login']), $errors['default'][0]);

$this->assertEquals($this->t('The %handler_type %handler uses a relationship that has been removed.', ['%handler_type' => 'field', '%handler' => 'User: Created']), $errors['default'][1]);

To:

$this->assertEquals('The <em class="placeholder">field</em> <em class="placeholder">User: Last login</em> uses a relationship that has been removed.', $errors['default'][0]);
    
$this->assertEquals('The <em class="placeholder">field</em> <em class="placeholder">User: Created</em> uses a relationship that has been removed.', $errors['default'][1]);

It seems to solve the problem with the last test that failed.

Needs review.

bruno.bicudo’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed this one.

It correctly adds the pattern rule */Plugin/* to core/phpcs.xml.dist

After running phpcs -- -ps as pointed by @aldairsoares on #78, no more warnings popping out, so i assume tests on all plugins are clean.

I also checked for the use of t() calls and StringTranslationTrait on tests as pointed by @alexpott on #84, and looks like they were all corrected as asked.

For the error on patch #88, it's corrected on #91 and the fix looks good for me (just needed the use of em tags on the text to reflect the correct result for the test, and the additional parentheses was also removed).

So far so good, i'm moving it to RTBC as it looks like all the goals were achieved. Thanks!

catch’s picture

Title: Replace t() with $this->t() in all plugins » [w/c September 17th] Replace t() with $this->t() in all plugins

Give this is a 223kb patch I think we might want to schedule it for beta, tentatively putting the week after the beta window in the issue title.

quietone’s picture

Component: field system » plugin system
Issue summary: View changes
Issue tags: +Coding standards

Add coding standards tag and add the phpcs.xml change to the proposed resolution. Also, this is changing more that field plugins so changing component.

At 124 files changed, 606 insertions, 530 deletions it make sense to schedule this for beta.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/Llama.php
    @@ -4,6 +4,7 @@
     use Drupal\ckeditor\CKEditorPluginInterface;
     use Drupal\Component\Plugin\PluginBase;
    +use Drupal\Core\StringTranslation\StringTranslationTrait;
     use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
     use Drupal\editor\Entity\Editor;
     use Symfony\Component\DependencyInjection\ContainerInterface;
    @@ -48,6 +49,8 @@ public static function create(ContainerInterface $container, array $configuratio
    
    @@ -48,6 +49,8 @@ public static function create(ContainerInterface $container, array $configuratio
         return $instance;
       }
     
    +  use StringTranslationTrait;
    +
       /**
    

    The use StringTranslationTrait; should be at the top of the class.

  2. +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
    @@ -3,6 +3,7 @@
     use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
    +use Drupal\Core\StringTranslation\StringTranslationTrait;
     
     /**
      * Tests that plugins are correctly discovered using annotated classes.
    @@ -10,6 +11,7 @@
    
    @@ -10,6 +11,7 @@
      * @group Plugin
      */
     class AnnotatedClassDiscoveryTest extends DiscoveryTestBase {
    +  use StringTranslationTrait;
     
       protected function setUp(): void {
         parent::setUp();
    @@ -26,7 +28,7 @@ protected function setUp(): void {
    
    @@ -26,7 +28,7 @@ protected function setUp(): void {
             'label' => 'Banana',
             'color' => 'yellow',
             'uses' => [
    -          'bread' => t('Banana bread'),
    +          'bread' => $this->t('Banana bread'),
    

    This is a test - it shouldn't be using the trait - it can use new TranslatableMarkup...

Ratan Priya’s picture

Assigned: Unassigned » Ratan Priya
Ratan Priya’s picture

Status: Needs work » Needs review
StatusFileSize
new223.15 KB
new1.97 KB

@alexpott,

I made the changes you required at comments #95

Needs review.

Ratan Priya’s picture

Assigned: Ratan Priya » Unassigned
bruno.bicudo’s picture

Status: Needs review » Reviewed & tested by the community

I reviewed #97 and the changes reflect what was pointed on #95 by @alexpott

Moving to RTBC again since the changes cover everything which was asked.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 97: 3181778-97.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new1.79 KB
new221.88 KB
new15.17 KB
new214.13 KB

Rerolling and adding patch for D10.

libbna’s picture

I have reviewed the above #101 patch for 9.5. And all the t() functions has been replaced with &this->t() .

But when I checked for other files there are some files in which t() is used. Like DateTime, EntityDisplayRepository, module.api.php, etc. So do we need to make changes in these files also? Though the title says to replace it only in plugins but still confirming it.

Not marking it as RTBC because of my doubt.

longwave’s picture

@Libbna this is only about making this change in plugins, so this issue should only touch code with /Plugin/ in the path - other files will be dealt with in other issues of this issue's parent.

libbna’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @longwave for clarifying my doubt. Then it is good to be marked as RTBC. I don't see any use of t() .

quietone’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new468 bytes
new221.93 KB
new468 bytes
new214.18 KB

Thanks for the RTBC!

This needs a reroll now that #3135933: Sort sniffs/rules in phpcs.xml.dist and write test to keep them sorted was committed

The last submitted patch, 105: 3181778-105-9.5.x.patch, failed testing. View results

quietone’s picture

Issue summary: View changes
Issue tags: -Novice +beta target
bbrala’s picture

Status: Needs review » Needs work

Looked through the change in 10.1:

ckeditor is no longer in core but is still in the patch. This needs fixing with a rebase i think.

First started a manual search and did find a few, then i did the automated test. Seems there is a lot to be found. I ran phpcs with phpcs.xml.dist only containing the gloabal snif (as kinda hinted at in #76)

It found a lot of errors. I think the fixer needs a rerun, or the filter (*/Plugin/*) is to broad if it shouldnt also include plugins like: core/modules/link/src/Plugin/Field/FieldType/LinkItem.ph.



FILE: /home/localcopy/drupal-core-10-0-x/web/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/CustomDirectoryAnnotatedClassDiscoveryTest.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 43 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/tests/Drupal/KernelTests/Core/Plugin/Discovery/AnnotatedClassDiscoveryTest.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 29 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/link/src/Plugin/Field/FieldType/LinkItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 107 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 108 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/link/src/Plugin/Field/FieldFormatter/LinkFormatter.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 101 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 105 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 122 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 128 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 145 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 148 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 152 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 155 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 159 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 162 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/path/src/Plugin/Field/FieldWidget/PathWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/file/src/Plugin/Field/FieldType/FileItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 118 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 120 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 124 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 126 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 137 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 140 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 156 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 158 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 167 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 180 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 182 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 190 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 192 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 140 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 196 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/file/src/Plugin/Field/FieldFormatter/TableFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 27 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 27 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/tests/modules/image_module_test/src/Plugin/Field/FieldFormatter/DummyAjaxFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 27 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/tests/modules/image_module_test/src/Plugin/ImageEffect/AjaxTestImageEffect.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 36 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/Field/FieldType/ImageItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 28 WARNINGS AFFECTING 28 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 176 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 179 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 184 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 202 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 205 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 209 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 218 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 222 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 229 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 232 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 236 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 245 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 249 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 259 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 261 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 266 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 268 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 278 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 280 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 285 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 297 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 415 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 426 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 427 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 438 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 439 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 445 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 446 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  74 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  99 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/Field/FieldFormatter/ImageFormatter.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 128 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 135 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 136 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 139 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 142 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 185 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 188 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 192 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 193 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/ImageEffect/ResizeImageEffect.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/ImageEffect/RotateImageEffect.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 6 WARNINGS AFFECTING 6 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  86 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  87 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/ImageEffect/ScaleImageEffect.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/ImageEffect/CropImageEffect.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 62 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 65 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 67 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 68 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 70 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 76 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/image/src/Plugin/ImageEffect/ConvertImageEffect.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 70 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/options/src/Plugin/Field/FieldType/ListFloatItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 55 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/options/src/Plugin/Field/FieldType/ListItemBase.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  87 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/options/src/Plugin/Field/FieldType/ListIntegerItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 55 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/options/src/Plugin/Field/FieldType/ListStringItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/user/src/Plugin/Action/ChangeUserRoleBase.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 65 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 81 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 101 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 49 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 63 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 81 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/text/src/Plugin/Field/FieldFormatter/TextTrimmedFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/comment/src/Plugin/Field/FieldType/CommentItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 13 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 113 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 128 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 129 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 130 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 136 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 141 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 144 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 145 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 146 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 188 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/comment/src/Plugin/Field/FieldWidget/CommentWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 8 WARNINGS AFFECTING 8 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 32 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 36 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 283 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/taxonomy/src/Plugin/migrate/D7TaxonomyTermDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 103 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockLayoutBlockDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/system/tests/modules/plugin_test/src/Plugin/plugin_test/mock_block/MockMenuBlockDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 39 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/system/tests/modules/plugin_test/src/Plugin/MockBlockManager.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  93 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 107 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 110 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 152 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 153 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 157 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 379 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 386 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/tests/src/Kernel/Plugin/RelationshipJoinTestBase.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/tests/modules/views_test_data/src/Plugin/views/field/FieldFormButtonTest.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 49 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/Derivative/ViewsEntityRow.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/Derivative/ViewsExposedFilterBlock.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 88 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/area/DisplayLink.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 132 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 133 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 134 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 135 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/area/View.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 121 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/area/TokenizeAreaPluginBase.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 51 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 1744 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
      |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 423 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 424 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/filter/InOperator.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 75 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 894 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 895 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/views/src/Plugin/views/field/Boolean.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 60 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 65 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/editor/tests/modules/src/Plugin/Editor/UnicornEditor.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/editor/tests/modules/src/Plugin/Editor/TRexEditor.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 208 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 270 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/Search/NodeSearch.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 12 WARNINGS AFFECTING 12 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 587 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 594 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 604 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 612 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 620 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 630 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 634 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 643 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 654 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 659 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 663 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 826 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/Action/AssignOwnerNode.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  91 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 122 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/Action/UnpublishByKeywordNode.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/migrate/D6NodeDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/migrate/source/d6/NodeRevision.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 33 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/migrate/source/d7/NodeRevision.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 31 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/node/src/Plugin/migrate/D7NodeDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/menu_link_content/src/Plugin/migrate/source/MenuLink.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 25 WARNINGS AFFECTING 25 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  76 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  77 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  78 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  80 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  81 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  85 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  86 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  87 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  88 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  89 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  91 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  92 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  93 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  95 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  99 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/responsive_image/src/Plugin/Field/FieldFormatter/ResponsiveImageFormatter.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 137 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 149 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 150 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 153 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 156 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 171 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 174 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 175 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 183 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/language/src/Plugin/Derivative/LanguageBlock.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 29 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/language/src/Plugin/Condition/Language.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 125 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 127 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  82 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  97 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 122 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 43 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldWidget/TestFieldWidgetMultiple.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 43 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 44 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldDefaultFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 39 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldPrepareViewFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldMultipleFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeFieldItemList.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 49 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 70 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 89 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 93 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 94 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/datetime/src/Plugin/Field/FieldWidget/DateTimeDatelistWidget.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 16 WARNINGS AFFECTING 13 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  96 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  98 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 104 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 106 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 111 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 114 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 115 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 116 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 118 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 143 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 145 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 146 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/datetime/src/Plugin/Field/FieldFormatter/DateTimeDefaultFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 55 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 71 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/ckeditor5/src/Plugin/Editor/CKEditor5.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 315 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/content_translation/src/Plugin/Derivative/ContentTranslationContextualLinks.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 49 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/media/src/Plugin/media/Source/OEmbedDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/migrate/tests/modules/migrate_sql_count_cache_test/src/Plugin/migrate/source/SqlCountCache.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/migrate/src/Plugin/migrate/id_map/Sql.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 682 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/migrate/src/Plugin/migrate/source/EmptySource.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/telephone/src/Plugin/Field/FieldType/TelephoneItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/telephone/src/Plugin/Field/FieldWidget/TelephoneDefaultWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 37 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 39 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 55 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 87 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/NumericItemBase.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  34 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  36 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  40 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  42 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  49 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  53 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  88 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 100 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 365 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 416 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 424 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 433 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DecimalItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 69 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 79 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 83 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 72 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsSelectWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 65 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 73 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 76 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/BooleanCheckboxWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 11 WARNINGS AFFECTING 11 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  43 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  57 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  78 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  81 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  84 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
  87 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 210 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 211 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextfieldWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 45 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/NumberWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 41 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 43 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 59 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/OptionsButtonsWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 67 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 48 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 64 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 66 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 5 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 45 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 47 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 58 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 61 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/DecimalFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 5 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 45 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 46 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 56 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceLabelFormatter.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 38 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 51 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 51 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/EntityReferenceEntityFormatter.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 133 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 149 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/NumericFormatterBase.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 9 WARNINGS AFFECTING 9 LINES
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 19 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 20 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 21 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 22 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 23 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 28 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 36 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 52 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Action/Plugin/Action/GotoAction.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 117 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 118 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Action/Plugin/Action/MessageAction.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 109 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 113 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 7 WARNINGS AFFECTING 7 LINES
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 166 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 169 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 173 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 176 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 180 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 184 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
 195 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
     |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Entity/Plugin/Derivative/DefaultSelectionDeriver.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 54 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/localcopy/drupal-core-10-0-x/web/core/lib/Drupal/Core/Entity/Plugin/EntityReferenceSelection/Broken.php
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 24 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and $this->t() instead
    |         | (DrupalPractice.Objects.GlobalFunction.GlobalFunction)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 1 mins, 28.71 secs; Memory: 218MB
bbrala’s picture

StatusFileSize
new168.13 KB
quietone’s picture

StatusFileSize
new3.24 KB
new211.1 KB

@bbrala, thanks for the review. However, I do not get the errors you reported when running phpcs on core with the patch applied.

This is a reroll of the 10.1 patch.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new3.51 KB
new222.07 KB

And a reroll for the 9.5.x patch.

longwave’s picture

Status: Needs review » Needs work

I also can't reproduce the issues that @bbrala reported.

Reviewed with git diff --color-words. The only thing that stood out:

+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItemBase.php
@@ -25,7 +25,6 @@ public static function defaultStorageSettings() {
-    // This is called very early by the user entity roles field. Prevent
     // early t() calls by using the TranslatableMarkup.

This comment was only partially removed; as it no longer makes sense we should remove both lines. This was already done in FieldTestItem, this just needs updating to match.

quietone’s picture

StatusFileSize
new705 bytes
new211.18 KB

@longwave, thanks for the prompt review.

The D10 patch needed a reroll and since only \Drupal\plugin_test\Plugin\plugin_test\mock_block\MockMenuBlockDeriver::getDerivativeDefinitions was affected this patch has the reroll plus the change requested in #112.

quietone’s picture

Status: Needs work » Needs review
StatusFileSize
new705 bytes
new222.16 KB

And repeating the above for 9.5.x.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Thank you. The interdiffs look good and DrupalCI is happy with the PHPCS changes so to me this is RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 6bbfb05500 to 10.1.x and a4c98c94ee to 10.0.x. Thanks!
Committed ea9a55e and pushed to 9.5.x. Thanks!

  • alexpott committed 6bbfb05 on 10.1.x
    Issue #3181778 by quietone, longwave, aldairsoares, beatrizrodrigues,...

  • alexpott committed ea9a55e on 9.5.x
    Issue #3181778 by quietone, longwave, aldairsoares, beatrizrodrigues,...

  • alexpott committed a4c98c9 on 10.0.x
    Issue #3181778 by quietone, longwave, aldairsoares, beatrizrodrigues,...

Status: Fixed » Closed (fixed)

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