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