1. Home
  2. Docs
  3. PHP Style Guide
  4. Commenting


In general, code should be commented prolifically. It not only helps describe the flow and intent of the code for less experienced programmers, but can prove invaluable when returning to your own code months down the line. There is not a required format for comments, but the following are recommended.

DocBlock style comments preceding class, method, and property declarations so they can be picked up by IDEs:

Use single line comments within code, leaving a blank line between large comment blocks and code.

Was this article helpful to you? Yes No

How can we help?