views:

46

answers:

3

According to PhpDocumntor each block of comment in order to be converted into a valid piece of documentation requires to be encapsulated like this:

/**
* This function is used blah, blah, blah
* line 2
* line 2
* ...
*/
function MyFunc($string) {...

Do you know if it's possible (maybe by changing some settings) to avoid being forced to place an asterisk in front of each line. I would basically like PhpDocumentor to accept and translate to documentation these type of comments:

/**
This function is used blah, blah, blah
line 2
line 2
...
*/
function MyFunc($string) {...

I'm asking because JsDOC and JavaDoc do not require a damn asterisk in front of each new line anymore, so I thought tat maybe also PhpDocumentor can do this by tricking a bit its settings, but I can't find anything about this on Google.

A: 

You have to remember if you change the way PhpDoc creates the documentation / auto complete information, the end user will need to change their settings as well should they wish to view your code with documentation / auto complete information.

I am not aware of this option in PhpDoc however you could try playing with the DocBlock templates.

Here is a link on playing with the doc block templates.

jostster
A: 

Maybe you should use an editor which places the asterisks for you, so you don't have to do it manually. Almost all PHP-compatible IDEs do it, as do many programmer's editors with PHP support.

Using the asterisk like that is the standard convention. Unless your code is going to be hidden away in a cave, under a ton of cement, where nobody will ever see it, it might be a good idea to follow the standard conventions.

Jani Hartikainen
As explained in the question JsDOC and JavaDoc do not force the asteisk anymore. So it's not such a standard! I see it ad a new feature that gives the coder the choice to decide whether he wants to use asterisk on each line or not.
Marco Demajo
It's a community-agreed standard in PHP. http://pear.php.net/manual/en/standards.sample.php http://framework.zend.com/manual/en/coding-standard.coding-style.html
Jani Hartikainen
A: 

There is no way to do it using PhpDocumentor.

I gave up on PhpDocumentor and started using Doxygen. For anyone who might be interested, Doxygen allows final user to document PHP function in many ways among which also like JavaDoc and JsDoc. And you are NOT forced to place a 'damn' asterisk at the beginning of each line in documentation, so the following comments are ok and will be properly parsed by Doxygen:

/**
... line1 ...
... line2 ...
*/
function MyFunc($string) {...  
Marco Demajo