[wp-trac] [WordPress Trac] #47407: Documentation `tests_add_filter` function incorrect

WordPress Trac noreply at wordpress.org
Mon May 27 13:05:50 UTC 2019


#47407: Documentation `tests_add_filter` function incorrect
------------------------------+-----------------------------
 Reporter:  remcotolsma       |      Owner:  SergeyBiryukov
     Type:  enhancement       |     Status:  assigned
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:                    |
------------------------------+-----------------------------
 In https://core.trac.wordpress.org/changeset/43555 some documentation was
 added for the `tests_add_filter` function. According the documentation the
 second parameter `$function_to_add` should be an `array` or an `object`:

 {{{
 @param object|array $function_to_add The function/callback to execute on
 call.
 }}}

 Should this not be changed to `callable`? Same as the `add_filter`
 function?
 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/plugin.php#L99

 Scrutinizer is complaining about this:

 '_manually_load_plugin' of type string is incompatible with the type
 array|object expected by parameter $function_to_add of tests_add_filter().

 https://scrutinizer-ci.com/g/pronamic/wp-money/inspections/3724dc22-f4fb-
 46cd-90bc-
 0928063ae820/issues/files/tests/bootstrap.php?status=failed&conditionIds%5B0%5D=367219#

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47407>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list