mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-19 09:31:18 +03:00
Updated String concatenation (markdown)
parent
fea051ee90
commit
cf1a84a0a6
1 changed files with 23 additions and 1 deletions
|
@ -38,3 +38,25 @@ $text = $greeting
|
|||
</div></details><br>
|
||||
|
||||
_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)
|
Loading…
Reference in a new issue