B
B
BonBon Slick2018-10-06 15:57:40
phpstorm
BonBon Slick, 2018-10-06 15:57:40

To set or not to set @return void?

I noticed that if the value is NOT void it requires typehint, but if void it skips it. What with return void and without it, it seems to display the same hint.
Is it worth it or not to write in doc block return type if the method returns void?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2018-10-06
@BonBonSlick

if the method is single line/short it can be omitted.
Again, the question is: why are dockblocks written?
for yourself - you can do whatever you like
for others - use common sense
to generate documentation - describe to the maximum

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question