With phpDocumentor, how do you document an optional parameter that has a default value like this:
public function myMethod ($param = 1234)
{
// ...
}
How do I write the @param
tag in the docblock to get the default value documented?
With phpDocumentor, how do you document an optional parameter that has a default value like this:
public function myMethod ($param = 1234)
{
// ...
}
How do I write the @param
tag in the docblock to get the default value documented?
The documentation is here
If you are not indicating in the actual code that the parameter is optional (via "$paramname = 'a default value'"), then you should mention in the parameter's description that the parameter is optional.
So for the source code in your question, you don't need to do anything. But if you don't include a default value for an optional parameter, you should include a note in the description detailing the default value.