mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-05 08:07:33 +02:00
Updated Calling functions (markdown)
@@ -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:
|
Reference in New Issue
Block a user