TranslatableMarkup is the OO replacement for t(). We should apply the same checks to the string as we do for t().

CommentFileSizeAuthor
#4 2710209.4.patch6.87 KBalexpott
#2 TranslateMarkup.patch1.99 KBalexpott
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
1.99 KB

Fortunately we can just at the class name to the list of functions because amusingly it supports that!

klausi’s picture

Status: Needs review » Needs work
  1. +++ b/coder_sniffer/Drupal/Test/Semantics/FunctionTUnitTest.inc
    @@ -12,4 +12,12 @@ class Test {
    +    return new TranslatableWrapper(' Do not start with a space');
    

    TranslatableWrapper does not exist in Drupal 8 core. Did you mean TranslationWrapper?

  2. +++ b/coder_sniffer/Drupal/Test/Semantics/FunctionTUnitTest.php
    @@ -14,7 +14,9 @@ class Drupal_Sniffs_Semantics_FunctionTUnitTest extends CoderSniffUnitTest
    +            16 => 1,
    

    can we do the indentation on the same level as in the getWarningList() method?

alexpott’s picture

Status: Needs work » Needs review
FileSize
6.87 KB

@klausi good spot.

klausi’s picture

Status: Needs review » Needs work

There are some unrelated changes in the patch?

  • klausi committed f472a6b on 8.x-2.x authored by alexpott
    Issue #2710209 by alexpott: The FunctionT sniff needs to support...
klausi’s picture

Status: Needs work » Fixed

Actually I can extract the good bits easily - committed, thanks!

Status: Fixed » Closed (fixed)

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