Welcome Guest, Not a member yet? Register   Sign In
How to use phpdoc correctly in this case
#2

[eluser]Dam1an[/eluser]
This is how I would do it
Code:
/**
* Update the users profile
* An optional longer description goes here
*
* @param String $id - The ID of the user to update
* @param Array $account_data - Any data to update for the user
* @return Boolean - Returns true on success and false otherwise
*/

I don't bother with the method signature as you did, as I get this from the auto complete within my IDE
I also don't put the version number for each function doc block, but I just put it in the class doc block (some people like to put the @since tag for the function)
I prefer to put each parameter on a seperate line and decalre the type bfore the variable
And finally with the return, I just specify the type and in what scenario you get which

At the end of the day, it's mainly a matter of peronal preference, so just do whatever works for you Smile


Messages In This Thread
How to use phpdoc correctly in this case - by El Forum - 07-27-2009, 08:18 AM
How to use phpdoc correctly in this case - by El Forum - 07-27-2009, 10:57 AM
How to use phpdoc correctly in this case - by El Forum - 07-30-2009, 08:48 AM
How to use phpdoc correctly in this case - by El Forum - 07-30-2009, 09:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB