mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-01 14:20:16 +02:00
Updated String concatenation (markdown)
@@ -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)
|
Reference in New Issue
Block a user