To help to decide between the other answers, there is one benefit in explicitly written @return {void}
. Although @return
can be omitted, for a documenting coder, seeing the @return {void}
works as a memory aid. It tells the coder that the return documentation is written. If there is no @return
written, then the coder might need to inspect did he forget to write the return value documentation or does the function truly return nothing.
Of course, the return value documentation might be outdated. That is something the coder cannot directly know from the docs and needs to read the code to verify. Still, seeing the return value written gives the coder a bit of certainty that the documentation is correct and not just hastily written.