mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-11-21 17:15:25 +03:00
Page:
if Statement
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
4
if Statement
LogMANOriginal edited this page 2018-11-05 13:46:28 +01:00
Use elseif
instead of else if
For sake of consistency else if
is considered bad practice.
Example
Bad
if($conditionA) {
} else if($conditionB) {
}
Good
if($conditionA) {
} elseif($conditionB) {
}
Reference: PSR2.ControlStructures.ElseIfDeclaration
Do not write empty statements
Empty statements are considered bad practice and must be avoided.
Example
Bad
if($condition) {
// empty statement
} else {
// do something here
}
Good (invert condition)
if(!$condition) {
// do something
}
Reference: Generic.CodeAnalysis.EmptyStatement
Do not write unconditional if-statements
If-statements without conditions are considered bad practice and must be avoided.
Example
if(true) {
}
RSS-Bridge · Reconnecting the Web ·