Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow up to #2692091: Use the new 'view label' entity access check in the entity reference label formatter. By changing the code one use statements is now not needed anymore
$ ../vendor/bin/phpcs
FILE: ...modules/user/src/Plugin/Field/FieldFormatter/AuthorFormatter.php
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
5 | WARNING | [x] Unused use statement
----------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
Comment | File | Size | Author |
---|---|---|---|
#2 | unused-use-2853984-3.patch | 584 bytes | klausi |
Comments
Comment #2
klausiPatch.
Comment #3
himanshu-dixit CreditAttribution: himanshu-dixit as a volunteer commentedLGTM, phpcs doesn't show any error now.
Comment #6
xjmHm looks like @catch's pre-commit hooks are still not working.
I confirmed that this is the only failure of this rule in core at the moment with:
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme --sniffs=Drupal.Classes.UnusedUseStatement core
Committed to 8.4.x and cherry-picked to 8.3.x. Thanks!