Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pear coding standards doubts

Following Pear Coding Standards:

  • Should I use _ before private methods or just for private properties?
  • Should I use methodName or method_name for methods?
  • Should I use public $fooBar or public $foo_bar?

Thank you.

like image 277
thom Avatar asked Mar 10 '26 04:03

thom


1 Answers

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.

like image 81
BoltClock Avatar answered Mar 11 '26 20:03

BoltClock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!