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.
From https://www.drupal.org/node/1353118
Classes and interfaces with a backslash \ inside their fully-qualified name (for example: Drupal\simpletest\WebTestBase) must not use their fully-qualified name inside the code. If the namespace differs from the namespace of the current file, put a use statement on the top of the file.
We should implement a sniff for that.
Comments
Comment #3
klausiCommitted a start for this.
The problem is now that the sniff also catches namespaced functions, which it should not do.
And then we also need a fixer for this to automatically insert use statements.
Comment #5
klausiFixed namespaced function calls.
Now the fixer implementation remains.
Comment #7
klausiImplemented the fixer.