|
EnCodingStyle
Coding style.
Lang-En
To participate in the project phpDays you should follow the same coding style (syntax for php, html, css, js and yaml files). General rules
Code sampleclass Days_Model_User {
// first position for constants: usee capital letters
const USER_FIELD = 'username';
// second position: properties. For private and protested properties use "_" prefix
private $_name;
protected $_name2;
// third position: methods
public static function test($x) {
if (10==$x) {
return true;
}
return false;
}
// before function definition set only one empty line
protected function _test2($x, $y=10) {
// not use empty lines into function code
if ($x==$y) {
return true;
}
return false;
}
}Autoformat your codeUse this regular expressions for automatically format code:
Rules for work with php files
Safety Information: | ||||||||||||||||||||||||||||
► Sign in to add a comment