Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSR12.Traits.UseDeclaration does not allow comments or blank lines between use statements #2673

Closed
gsherwood opened this issue Oct 27, 2019 · 1 comment
Milestone

Comments

@gsherwood
Copy link
Member

This issue continues to be a problem for subsequent comments.

Example A:

class ClassName
{
    /**
     * DocBlockContent
     */
    use FirstTrait;
    use SecondTrait;
    use ThirdTrait;
}

Example B:

class ClassName
{
    /**
     * DocBlockContent
     */
    use FirstTrait;

    /**
     * DocBlockContent
     */
    use SecondTrait;

    /**
     * DocBlockContent
     */
    use ThirdTrait;
}

Example A passes the tests, while Example B does not. Being unable to properly document your Traits isn't helpful at all.

Originally posted by @AlecWeekes in #2628 (comment)

@gsherwood gsherwood added this to the 3.5.2 milestone Oct 27, 2019
@gsherwood gsherwood changed the title PSR12.Traits.UseDeclaration does not allow comments a blank lines between use statements PSR12.Traits.UseDeclaration does not allow comments or blank lines between use statements Oct 27, 2019
gsherwood added a commit that referenced this issue Oct 27, 2019
@gsherwood
Copy link
Member Author

@AlecWeekes Thanks for reporting this issue. The sniff should have been ensuring that 2 import statements were not on the same line, but did this by ensuring the statements were on the line directly following the last. PSR-12 doesn't say this is required, so that was just a bug in the sniff.

Will be fixed in 3.5.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant