From 65fe2db5a9f8c57e395ea0d77d6338dd5f9b133c Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Mon, 5 Nov 2018 13:31:05 +0100 Subject: [PATCH] Created Whitespace (markdown) --- Whitespace.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Whitespace.md 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