[wp-trac] [WordPress Trac] #52539: callable typehint thows static analysis errors

WordPress Trac noreply at wordpress.org
Wed Feb 17 16:59:41 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 johnbillion):

 My preference would be to retain the existing `callable` type in `@param`
 and switch any incompatible default values (eg `''`) to `null`, but `null`
 is also not valid for a callable without it being made nullable via
 `callable|null`. ''However'', core is definitely not consistent in that
 regard currently, ie. there are instances of parameters that are nullable
 but not documented as such. That is a wider issue.

 Renaming the various callable parameters is sorely needed but I think that
 can be handled in a separate ticket.

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


More information about the wp-trac mailing list