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

Generic.WhiteSpace.Disallow[Space/Tab]Indent not inspecting content before open tag #1762

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Nov 26, 2017

Both these sniffs include T_INLINE_HTML in the $checkTokens array, but would only start checking the file after the first PHP open tag, so if a file - such as a view - would start with inline HTML and only have the first PHP open tag on line 5, the first 4 lines would not be inspected, nor fixed for tabs vs spaces.

I have not added unit tests for this as it would require to either renumber all the unit tests òr to add a second unit test file for both sniffs. If so desired, I'd be happy to make those changes, but it seemed a bit over the top for such a small change.

Both these sniffs include `T_INLINE_HTML` in the `$checkTokens` array, but would only start checking the file **after** the first PHP open tag, so if a file - such as a view - would start with inline HTML and only have the first PHP open tag on line 5, the first 4 lines would not be inspected, nor fixed for tabs vs spaces.

I have not added unit tests for this as it would require to either renumber all the unit tests òr to add a second unit test file for both sniffs. If so desired, I'd be happy to make those changes, but it seemed a bit over the top for such a small change.
@gsherwood gsherwood added this to the 3.2.0 milestone Nov 27, 2017
@gsherwood gsherwood changed the title WhiteSpace/DisallowSpace/TabIndent: bug fix - inspect complete file Generic.WhiteSpace.Disallow[Space/Tab]Indent not inspecting content before open tag Nov 27, 2017
@gsherwood
Copy link
Member

Thanks for this fix.

@gsherwood gsherwood merged commit 0b2d95d into squizlabs:master Nov 27, 2017
gsherwood added a commit that referenced this pull request Nov 27, 2017
@jrfnl jrfnl deleted the feature/fix-whitespace-indent-sniffs-walk-complete-files branch November 27, 2017 02:40
@jrfnl
Copy link
Contributor Author

jrfnl commented Nov 27, 2017

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

Successfully merging this pull request may close these issues.

2 participants