mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-21 09:05:26 +03:00
Page:
Functions
Pages
Actions
Arrays
Authentication
Bridge API
BridgeAbstract
Cache API
CacheInterface
Casting
Classes
Coding style policy
Command Line Interface (CLI)
Constants
Custom Configuration
Customizations
Debug mode
Docker
Extended Bridges
FAQ
FeedExpander
Folder structure
For developers
For hosts
Format API
FormatAbstract
FormatInterface
Functions
Heroku Installation
Home
How can I contribute
How to create a new Bridge
How to create a new Cache
How to create a new Format
Indentation
Installation
Keywords
Maximum line length
Operators
Project goals
Public hosts
Pull request policy
RSS Bridge on PHP 5.4
Read queriedContext
Requirements
Screenshots
Strings
Structures
Technical Recommendations
The collectData function
The detectParameters function
The getContents function
The getDescription function
The getIcon function
The getInput function
The getMaintainer function
The getName function
The getSimpleHTMLDOM function
The getSimpleHTMLDOMCached function
The getURI function
The returnClientError function
The returnError function
The returnServerError function
Updating
Web server links
Whitelisting
Whitespace
XPathAbstract
const PARAMETERS
defaultLinkTo
if Statement
No results
2
Functions
LogMANOriginal edited this page 2018-11-05 13:28:10 +01:00
Parameters with default values must appear last in functions
It is considered good practice to make parameters with default values last in function declarations.
Example
Bad
function showTitle($duration = 60000, $title) { ... }
Good
function showTitle($title, $duration = 60000) { ... }
Reference: PEAR.Functions.ValidDefaultValue
Calling functions
Function calls must follow a few rules in order to maintain readability throughout the project:
Do not add whitespace before the opening parenthesis
Example
Bad
$result = my_function ($param);
Good
$result = my_function($param);
Do not add whitespace after the opening parenthesis
Example
Bad
$result = my_function( $param);
Good
$result = my_function($param);
Do not add a space before the closing parenthesis
Example
Bad
$result = my_function($param );
Good
$result = my_function($param);
Do not add a space before a comma
Example
Bad
$result = my_function($param1 ,$param2);
Good
$result = my_function($param1, $param2);
Add a space after a comma
Example
Bad
$result = my_function($param1,$param2);
Good
$result = my_function($param1, $param2);
Reference: Generic.Functions.FunctionCallArgumentSpacing
Do not add spaces after opening or before closing bracket
Parenthesis must tightly enclose parameters.
Example
Bad
if( $condition ) { ... }
Good
if($condition) { ... }
RSS-Bridge · Reconnecting the Web ·