开发者

Pear coding standards doubts

Following Pear Coding Standards:

  • Should I use _ before private methods or just for private properties?
  • Should I us开发者_开发知识库e methodName or method_name for methods?
  • Should I use public $fooBar or public $foo_bar?

Thank you.


Should I use _ before private methods or just for private properties?

Use _ before all private member names. This includes properties and methods.

Should I use methodName or method_name for methods?

Use camel case (that means methodName).

Should I use "public $fooBar" or "public $foo_bar" ?

Separate words with underscores (that means $foo_bar).

Some of these are mentioned in the Class Variables and Methods section of the PEAR naming conventions document.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜