[wp-meta] [Making WordPress.org] #6433: Issue with numbered variables names in devhub’s docblock parser

Making WordPress.org noreply at wordpress.org
Mon Aug 8 23:34:21 UTC 2022


#6433: Issue with numbered variables names in devhub’s docblock parser
---------------------------+-------------------------
 Reporter:  audrasjb       |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:
Component:  Developer Hub  |   Keywords:  needs-patch
---------------------------+-------------------------
 While reviewing [https://github.com/WordPress/wordpress-develop/pull/3075
 this PR], I found that numbered variable names in docblocks are not well
 interpreted by the docblock parser.

 For example, take the `parse_db_host()` function:

 Here is the docblock:

 {{{
         /**
          * Parses the DB_HOST setting to interpret it for
 mysqli_real_connect().
          *
          * mysqli_real_connect() doesn't support the host param including
 a port or socket
          * like mysql_connect() does. This duplicates how mysql_connect()
 detects a port
          * and/or socket file.
          *
          * @since 4.9.0
          *
          * @param string $host The DB_HOST setting to parse.
          * @return array|false {
          *     Array containing the host, the port, the socket and
          *     whether it is an IPv6 address, in that order.
          *     False if the host couldn't be parsed.
          *
          *     @type string      $0 Host name.
          *     @type string|null $1 Port.
          *     @type string|null $2 Socket.
          *     @type bool        $3 Whether it is an IPv6 address.
          * }
          */
         public function parse_db_host( $host ) {

 }}}

 [https://developer.wordpress.org/reference/classes/wpdb/parse_db_host/
 Here is the result in DevHub]. The first parameter name, `$0`, is not
 rendered.

 Same goes with other docblocks, like for example
 [https://developer.wordpress.org/reference/functions/wp_maybe_grant_site_health_caps/
 wp_maybe_grant_site_health_caps()].

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/6433>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list