[wp-trac] [WordPress Trac] #44450: Functions/methods do not return any value in classes should use @return void in method doc
WordPress Trac
noreply at wordpress.org
Fri Apr 5 11:21:42 UTC 2019
#44450: Functions/methods do not return any value in classes should use @return
void in method doc
-------------------------------------+-------------------------------------
Reporter: subrataemfluence | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Widgets | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-refresh | Focuses: docs, coding-standards
-------------------------------------+-------------------------------------
Comment (by subrataemfluence):
@DrewAPicture I understand what you said. But it is not only about adding
`@return void` just because of completeness. Rather `Docblocks` should
probably be written in such a manner so that it gives a complete overview
of the function itself.
For example, we use parameter types along with their descriptions, a
description of the function itself to explain what a function actually
does. And we do all these only to make the objective of a function easily
understandable without even going through its body. And my personal
feeling is **return type** should also fall in this category.
I do understand that it would be a lot of update in core coding but having
a return type even it is `void` will make things more logical from a
developer's point of view.
However, since `@return void` has been removed in purpose, I don't think
it will be taken back anymore. I only wanted to explain the way how I see
it.
Thank you!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44450#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list