[wp-trac] [WordPress Trac] #52539: callable typehint thows static analysis errors
WordPress Trac
noreply at wordpress.org
Tue Feb 16 18:27:09 UTC 2021
#52539: callable typehint thows static analysis errors
--------------------------+------------------------------
Reporter: dingo_d | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses: docs
--------------------------+------------------------------
Comment (by johnjamesjacoby):
Good thoughts @johnbillion. Now that you mention them, I agree with you,
too.
I’m speculating here, but because callables are strings or arrays (in the
case of class methods) it may even be unintentionally confusing to include
`string` in the docs at all.
At the risk of scope-creeping this too much (changing the default
parameter values to `null` wasn’t on my mind) do you see this as an
opportunity to consider auditing the names of the relevant variables?
`$function` and `$callback` are nice and obvious but lack context like
many of the other variable names have, like `$sanitize_callback` for
example.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52539#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list