I have a function which uses an attribute passed as reference:
public function doSomething(&$argumentPassedByReference)
{
// ...
}
I maintain the PHPDoc of my project, so I described my function like this:
/**
* Do something very useful with the thing passed in parameters
*
* @param Type $argumentPassedByReference Thing that will be edited
*/
public function doSomething(&$argumentPassedByReference)
But I'm not really satisfied because it doesn't show that $argumentPassedByReference
is passed by reference. Is there a standard in PHPDoc to describe this?
Add the ampersand as in the function definition:
/**
* Do something very useful with the thing passed in parameters
*
* @param Type &$argumentPassedByReference Thing that will be edited
*/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With