diff --git a/Whitespace.md b/Whitespace.md index 215bdb4..9065b0a 100644 --- a/Whitespace.md +++ b/Whitespace.md @@ -1,3 +1,30 @@ +# Add a new line at the end of a file + +Each PHP/CSS/HTML file must end with a new line at the end of a file. + +
Example

+ +**Bad** + +```PHP +{ + // code here +} // This is the end of the file +``` + +**Good** + +```PHP +{ + // code here +} +// This is the end of the file +``` + +

+ +_Reference_: [`PSR2.Files.EndFileNewline`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php) + # Do not add a whitespace before a semicolon A semicolon indicates the end of a line of code. Spaces before the semicolon is unnecessary and must be removed.