Display and enforce PSR-2 whitespace/newline styles #154
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch does three things:
Also noticed in a comment somewhere that
require-final-newlinecould cause trouble. This is not entirely true.If you end your file with
?>\nit wont be a problem, but if you end it with?>\n\nit will be.But
delete-trailing-whitespacewill also clear empty lines at the end of the file if they are empty. So it won't cause any trouble as far as I can see.PSR-2 also states that you shouldn't have any whitespaces at ends of lines, and the PHP CodeSniffer utility that people use requires you to have one newline at end of files.
The first patch was indent, this is whitespaces and newlines. PSR-2 got more rules about it, but that's alot more work to fix... Some day maybe.