01/08 2015
CGL improvements planned

We always try to improve the code structure and also automate checks for desired CGL (coding guidelines) in pull requests. A significant change is coming for these coding guidelines.

Array Syntax

One of the biggest inconsistencies in PHP was array syntax. Function uses (), arrays uses [] and (). Since PHP 5.4 short array syntax works in all array declarations. Our coding style guidelines will change to require the shorthand syntax.

Disallow is_null

"Is NULL" should be compared via if NULL === $variable. No more calls to "is_null()" and other functions that can be compared using type comparison.

Stronger code checks

Right now we test for example the space between if and (, but we have no test for = in a variable assignment. Checks have been added for these smaller formatting requirements.

Exception declaration and comment in PHPdoc

 

Whitespaces at end of line

PHP comments: space before asterisks

Single space after type cast

After => array starts in same line

Note: Most listed changes already perfectly in code and done by most IDEs.