- 🇳🇿New Zealand quietone
Gather the issue working to fix t() in one place, tag for Coding standards, update the IS and move to the 'other' component.
- 🇬🇧United Kingdom jonathan1055
Adding parent because this is fixing a DrupalPractice rule
There's many places in core where t()
function is used in classes without dependency injection.
It makes this classes hard to unit test because t()
defined in core/includes/bootstrap.inc
Also it makes harder to get rid of this include in later core
The sniff is already enabled for Plugins, in phpcs.xml.dist
<rule ref="DrupalPractice.Objects.GlobalFunction">
<include-pattern>*/Plugin/*</include-pattern>
</rule>
Replace usage with one of following ways
- $this->t()
for controllers using StringTranslationTrait
or add if it's missing
- new TranslatableMarkup()
in static methods
Need a final issue to enable the sniff and fix any remaining problems.
no
no
n/a
Active
11.0 🔥
It involves compliance with, or the content of coding standards. Requires broad community agreement.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Gather the issue working to fix t() in one place, tag for Coding standards, update the IS and move to the 'other' component.
Adding parent because this is fixing a DrupalPractice rule