You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use ... on top of a file - import a class/interface/trait
use ... inside a class - include a trait in a class
If they are tokenized using same T_USE token (and I guess it is the case), then PHP_CodeSniffer assumption that T_USE token is a scope opener is wrong in 2nd use case (where trait is included into a class).
Interesting part is if namespace Papagei\Scheduler; is used instead of namespace Papagei\Scheduler { then no scope error happens.
gsherwood
changed the title
Scope indent strange behaviour
Namespace not tokenized correctly when followed by multiple use statements
Aug 20, 2015
Hi,
When I launch PHP_CodeSniffer (v2.3.3 ) on this code :
I have these messages :
This could be ok but with this code :
I have no error. This behaviour seems to be strange : Without "use" : no error, with "use" Scope Indent error.
My phpcs.xml is :
Is it a bug of PHP_CodeSniffer ?
The text was updated successfully, but these errors were encountered: