Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jan 16, 2020

As discussed in issue #2822, this changes the sniff to ignore while() and forconstructs without body.

This - partially - undoes the unit tests added for issue #1932, but there are still some remaining covering that issue.

Fixes #2822


Edit: I've updated the PR to now also allow for for structures without body. See the accompanied unit test.

As discussed in issue 2822, this changes the sniff to ignore `while()` and `for` constructs without body.

This - partially - undoes the unit tests added for issue 1932, but there are still some remaining covering that issue.

Fixes 2822
@jrfnl jrfnl force-pushed the feature/2822-generic-inlinecontrolstructures-bug-fix branch from 8e2f481 to 13c803b Compare January 30, 2020 00:28
@gsherwood gsherwood added this to the 3.5.4 milestone Jan 30, 2020
gsherwood added a commit that referenced this pull request Jan 30, 2020
@gsherwood gsherwood merged commit 13c803b into squizlabs:master Jan 30, 2020
@gsherwood
Copy link
Member

Thanks for fixing this up. I actually had no idea you could have WHILEs and FORs with no body. I guess I just never tried.

@jrfnl jrfnl deleted the feature/2822-generic-inlinecontrolstructures-bug-fix branch January 30, 2020 22:01
@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 30, 2020

I was running some tests and it turns out that even foreach and if statements can be without body, though I can't imagine a case in which that could ever useful, so unless someone reports a bug for it, I don't think we need to account for it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generic/InlineControlStructures: sniff does not allow while without body

2 participants