From 0d0798009e3b01450d44553aed91d042740526da Mon Sep 17 00:00:00 2001 From: LogMANOriginal Date: Mon, 5 Nov 2018 13:32:12 +0100 Subject: [PATCH] Created Casting (markdown) --- Casting.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Casting.md diff --git a/Casting.md b/Casting.md new file mode 100644 index 0000000..e50cf1f --- /dev/null +++ b/Casting.md @@ -0,0 +1,21 @@ +# Do not add spaces when casting + +The casting type should be put into parenthesis without spaces. + +
Example

+ +**Bad** + +```PHP +$text = ( string )$number; +``` + +**Good** + +```PHP +$text = (string)$number; +``` + +

+ +_Reference_: [`Squiz.WhiteSpace.CastSpacing`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php) \ No newline at end of file