[wp-trac] [WordPress Trac] #45529: Correct phpdoc example for Internal Pointers

WordPress Trac noreply at wordpress.org
Thu Oct 3 00:13:51 UTC 2019


#45529: Correct phpdoc example for Internal Pointers
-------------------------------------------------+-------------------------
 Reporter:  daleharrison                         |       Owner:  garrett-
                                                 |  eclipse
     Type:  defect (bug)                         |      Status:  accepted
 Priority:  normal                               |   Milestone:  5.3
Component:  Administration                       |     Version:  3.3
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-refresh 2nd-opinion  |     Focuses:  docs
-------------------------------------------------+-------------------------

Comment (by jrf):

 Hi @garrett-eclipse I saw your question on Slack about how to do and/or
 whether to have code samples in the docblock.

 Where appropriate, this is perfectly fine to use.

 There's even a Docs coding standard covering it:
 https://make.wordpress.org/core/handbook/best-practices/inline-
 documentation-standards/php/#description-formerly-long-description

 Note: It is strongly recommended that the code sample complies with the
 PHP coding standards.

 Looking at your patch, looks like all you need to change is:
 * Add a blank line before the code sample.
 * Change the number of spaces between for the initial indentation of the
 code sample from 5 to 4.

 Hope this helps.

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


More information about the wp-trac mailing list