PHP coding specification (11 ). 5.4 class declaration when writing a class, the following format rules should be observed:-left brackets before the method name and its parameter list (do not have spaces between them-left braces {located in the declaration statement
Declaration of the 5.4 class
When writing a category, follow the following format rules:
-Do not have spaces between the left brackets before the method name and its parameter list.
-The left braces "{" are at the end of the statement.
-The right braces "}" start another line and align with the corresponding statement. unless it is an empty statement, "}" should be followed "{"
Class Sample extends Object {
Int $ ivar1;
Int $ ivar2;
Function Sample (int $ I, int $ j ){
Ivar $1 = $ I;
Ivar $2 = $ j;
}
Function emptyMethod (){}
...
}
-Separate methods with empty lines
The declaration of http://www.bkjia.com/PHPjc/532593.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/532593.htmlTechArticle5.4 classes should follow the following format rules when writing classes: -The left parenthesis before the method name and its parameter list "(" do not have spaces-the left braces "{" are located in the same way as the declaration statement...