Consider commenting your code using documentation : software documentation can be automatically generated from source code comments, which is very useful and will become a problem sooner or later.
I think it is safe to say that phpDocumentor notation has reached the status of the industry standard PHP standard. Their tutorial gives a good description of how this works. Here is a complete sample PHP file with phpDoc style comments. In short, the documentation standard must precede each file, class, and method with "docBlocks":
function myfunc ($param1, $param2) { ... }
phpDocumentor has several predefined keywords @keyword : @license , @version , @deprecated and many others.
many PHP-IDEs recognize this notation and can extract from it the search information that appears as you type.
The keyword that many IDEs use to compile task lists is @todo .
One area in which phpDoc and spouses do not set rules is inline comments, such as the ones you have between specific steps.
There are no binding rules here, as far as I know; however, over the years, and especially since I joined SO, I have been less and less hard at commenting on every step of my code, adopting the philosophy of “good code, have to comment on yourself” .
This means limiting comments on things that are not yet obvious from the code, and the names of the variables used. (Good options in variable names are extremely important, more important than a detailed comment!)
source share