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.Files.OpenTag incorrectly identifies PHP file with only an opening tag #2664

Closed
grantlucas opened this issue Oct 23, 2019 · 3 comments
Closed
Milestone

Comments

@grantlucas
Copy link

grantlucas commented Oct 23, 2019

When trying out the latest PSR-12 support, I found that PSR12.Files.OpenTag.NotAlone was triggering on PHP files where there is just an opening PHP tag. We have some of these in our project due to framework reasons. It's not great but kind of required.

Triggers error

<?php

[phpcs] Opening PHP tag must be on a line by itself (PSR12.Files.OpenTag.NotAlone)

Doesn't trigger error

<?php

// comment

Please correct me if I'm wrong but I don't see anywhere in PSR-12 where a PHP file can't just have an opening tag, however useless.

@gsherwood gsherwood added this to the 3.5.2 milestone Oct 23, 2019
@gsherwood gsherwood changed the title PSR12.Files.OpenTag.NotAlone incorrectly identifies PHP file with only an opening tag in it PSR12.Files.OpenTag incorrectly identifies PHP file with only an opening tag Oct 23, 2019
gsherwood added a commit that referenced this issue Oct 23, 2019
@gsherwood
Copy link
Member

Thanks for reporting this. A fix will be in 3.5.2.

@grantlucas
Copy link
Author

😮 🎉 Fasted bug fix ever. Thanks!

@gsherwood
Copy link
Member

⏱️ You're welcome

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

2 participants