Skip to content

PSR12.Traits.UseDeclaration ignores block comments #2790

@maras3000

Description

@maras3000

/src/Standards/PSR12/Sniffs/Traits/UseDeclarationSniff.php ignores block comments.

For example this will cause the The first trait import statement must be declared on the first non-comment line after the class opening brace error to be shown:

class MyClass
{
    /*
    some comment
    */
    use RegistersUsers;

while this will not:

class MyClass
{
    use RegistersUsers;

    /*
    some comment
    */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions