mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-06-10 16:44:54 +02:00
Updated String concatenation (markdown)
@ -1,3 +1,25 @@
|
||||
PHP supports both single quote strings and double quote strings. For pure text you must use single quote strings for consistency. Double quote strings are only allowed for special characters (i.e. `"\n"`) or inlined variables (i.e. `"My name is {$name}"`);
|
||||
|
||||
<details><summary>Example</summary><div><br>
|
||||
|
||||
**Bad**
|
||||
|
||||
```PHP
|
||||
echo "Hello World!";
|
||||
```
|
||||
|
||||
**Good**
|
||||
|
||||
```PHP
|
||||
echo 'Hello World!';
|
||||
```
|
||||
|
||||
</div></details><br>
|
||||
|
||||
_Reference_: [`Squiz.Strings.DoubleQuoteUsage`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php)
|
||||
|
||||
***
|
||||
|
||||
The concatenation operator should have one space on both sides in order to improve readability.
|
||||
|
||||
<details><summary>Example</summary><div><br>
|
Reference in New Issue
Block a user