Since version 8.3.5,

Such code is now producing an error with PHPCS:

  $build = array(
    '#type' => 'link',
    '#title' => t('More information about text formats'),
    '#href' => 'filter/tips',
    '#options' => array(
      'attributes' => array(
        'target' => '_blank',
      ),
    ),
  );

It says:

#options values usually have to run through t() for translation (DrupalPractice.General.OptionsT.TforValue)

Comments

Pol created an issue. See original summary.

pol’s picture

Status: Active » Closed (works as designed)

I just noticed that this was there maybe before drupal/coder:8.3.5.

If you do not use the DrupalPractice ruleset, you won't have this issue.