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

WordPress Trac noreply at wordpress.org
Sat Oct 26 00:17:30 UTC 2019


#47407: Documentation `tests_add_filter` function incorrect
------------------------------+-----------------------------
 Reporter:  remcotolsma       |       Owner:  SergeyBiryukov
     Type:  enhancement       |      Status:  assigned
 Priority:  normal            |   Milestone:  5.4
Component:  Build/Test Tools  |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  needs-patch       |     Focuses:
------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review => 5.4


Old description:

> 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#

New description:

 In [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#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list