开发者

Pear coding standards doubts

开发者 https://www.devze.com 2023-02-10 16:51 出处:网络
Following Pear Coding Standards: Should I use _ before private methods or just for private properties?

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

精彩评论

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

关注公众号