[wp-trac] [WordPress Trac] #24900: PHPDocs for $wp_admin_bar in admin-bar.php
WordPress Trac
noreply at wordpress.org
Thu Sep 5 21:00:00 UTC 2013
#24900: PHPDocs for $wp_admin_bar in admin-bar.php
--------------------------+---------------------
Reporter: jeremyfelt | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 3.7
Component: Inline Docs | Version: 3.1
Severity: normal | Resolution: fixed
Keywords: has-patch |
--------------------------+---------------------
Comment (by nacin):
Further: In the latest version of PHP, you can only type-hint certain non-
scalar structures, like objects, arrays, and interfaces (also callable).
The language is by its very nature a loosely typed language. `@param bool
$strict` Means that `$strict` should be a boolean. But we can't enforce
that in a type-hint, and frankly we don't care in this case as long as it
is truthy or falsy.
We can code defensively to a point, but at some point, documentation can
and will be more strict than the actual code.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24900#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list