[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
Mon Jun 25 14:49:25 UTC 2018


#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:  5.0
Component:  Widgets           |     Version:  trunk
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:  docs, coding-standards
------------------------------+-------------------------------------

Comment (by pbiron):

 Replying to [ticket:44450 subrataemfluence]:
 > There are many other areas in the core which are using this approach. We
 need to be consistent.

 The vast majority of core does **not** use `@return void` when it applies,
 presumably because the [[https://make.wordpress.org/core/handbook/best-
 practices/inline-documentation-standards/php/#1-functions-class-
 methods|DocBlock Formating: Functions & Class Methods]] section of the
 handbook specifically says:

 > @return: Should contain all possible return types, and a description for
 each. Use a period at the end. Note: @return void should not be used
 outside of the default bundled themes.

 But I whole-heartedly agree that `@return void` **should** be used
 everywhere it applies!

 p.s. thank you **so much** for all of the DocBlock-related tickets you've
 been creating lately!

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44450#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list