Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#47407 assigned enhancement

Documentation `tests_add_filter` function incorrect

Reported by: remcotolsma Owned by: SergeyBiryukov
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: needs-patch
Focuses: Cc:
PR Number:


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?

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().


Change History (1)

#1 @dkarfa
5 months ago

tests_add_filter( 'muplugins_loaded', array( $this, '_manually_load_plugin' ) );

public function _manually_load_plugin() {
    // Function to do.
Note: See TracTickets for help on using tickets.