diff --git a/Whitespace.md b/Whitespace.md new file mode 100644 index 0000000..215bdb4 --- /dev/null +++ b/Whitespace.md @@ -0,0 +1,27 @@ +# 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. + +
Example

+ +**Bad** + +```PHP +echo 'Hello World!' ; +``` + +**Good** + +```PHP +echo 'Hello World!'; +``` + +

+ +_Reference_: [`Squiz.WhiteSpace.SemicolonSpacing`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php) + +# Do not add whitespace at start or end of a file or end of a line + +Whitespace at the end of lines or at the start or end of a file is invisible to the reader and absolutely unnecessary. Thus it must be removed. + +_Reference_: [`Squiz.WhiteSpace.SuperfluousWhitespace`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php) \ No newline at end of file