Php – Declaring lots of variables for phpdoc without starting each with /**

documentationPHPphpdoc

I have objects with many variables that I declare and explain in the comments. I am commenting very thoroughly for later processing using phpDoc, however I have no experience with actually compiling the documentation yet.

I find it very annoying that with phpDoc notation, each variable eats up four to six lines of code even if the only attribute I want to set is the description:

/**
 * @desc this is the description
 */

 var $variable = null;

I would like to use the following notation:

# @desc this is the description
var $variable = null;

is there a simple way to tweak phpDoc into accepting this, or will it give me trouble when I actually try to compile documentation out of it? I don't need the tweak now (although it's appreciated of course), just a statement from somebody who knows phpDoc whether this is feasible without having to re-engineer large parts of its code.

Best Answer

Just write one-line docblocks

/** @desc this is the description */
var $variable = null;

Problem solved.

Related Topic