1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-05 08:07:33 +02:00

Updated Calling functions (markdown)

LogMANOriginal
2018-11-05 13:27:29 +01:00
parent e52f894e09
commit af5c3ad63b

@@ -1,3 +1,25 @@
# Parameters with default values must appear last in functions
It is considered good practice to make parameters with default values last in function declarations.
<details><summary>Example</summary><div><br>
**Bad**
```PHP
function showTitle($duration = 60000, $title) { ... }
```
**Good**
```PHP
function showTitle($title, $duration = 60000) { ... }
```
</div></details><br>
_Reference_: [`PEAR.Functions.ValidDefaultValue`](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php)
# Calling functions
Function calls must follow a few rules in order to maintain readability throughout the project: