[wp-trac] [WordPress Trac] #24900: PHPDocs for $wp_admin_bar in admin-bar.php

WordPress Trac noreply at wordpress.org
Sun Sep 1 21:55:54 UTC 2013


#24900: PHPDocs for $wp_admin_bar in admin-bar.php
--------------------------+-----------------------
 Reporter:  jeremyfelt    |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  3.7
Component:  Inline Docs   |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+-----------------------
Changes (by toscho):

 * cc: info@… (added)
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 These doc blocks are wrong: no function in this file requires an instance
 of `WP_Admin_Bar`. To make the doc blocks true, we have to add a type hint
 like this:

 {{{
 function wp_admin_bar_search_menu( WP_Admin_Bar $wp_admin_bar ) {
 }}}

 Currently, these functions accept any class with a matching set of public
 methods, no matter what they do. Doc blocks should never lie, this is
 sloppy code.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24900#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list