Updated String concatenation (markdown)

LogMANOriginal 2018-11-05 13:15:17 +01:00
parent fea051ee90
commit cf1a84a0a6

@ -38,3 +38,25 @@ $text = $greeting
</div></details><br> </div></details><br>
_Reference_: [`Squiz.Strings.ConcatenationSpacing`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php) _Reference_: [`Squiz.Strings.ConcatenationSpacing`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php)
***
While concatenation is useful for combining variables with other variables or static text. It should not be used to combine two sets of static text. See also: [Maximum line length](Maximum-line-length)
<details><summary>Example</summary><div><br>
**Bad**
```PHP
$text = 'This is' . 'a bad idea!';
```
**Good**
```PHP
$text = 'This is a good idea!';
```
</div></details><br>
_Reference_: [`Generic.Strings.UnnecessaryStringConcat`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php)