mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-18 17:10:29 +03:00
Updated String concatenation (markdown)
parent
cf1a84a0a6
commit
3d49fb0217
1 changed files with 22 additions and 0 deletions
|
@ -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.
|
The concatenation operator should have one space on both sides in order to improve readability.
|
||||||
|
|
||||||
<details><summary>Example</summary><div><br>
|
<details><summary>Example</summary><div><br>
|
Loading…
Reference in a new issue