[wp-trac] [WordPress Trac] #43627: Method call uses 2 parameters, but method signature uses 1 parameters
WordPress Trac
noreply at wordpress.org
Wed May 6 16:25:23 UTC 2020
#43627: Method call uses 2 parameters, but method signature uses 1 parameters
------------------------------------------+-----------------------------
Reporter: kaggdesign | Owner: SergeyBiryukov
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.5
Component: Script Loader | Version: 4.9.4
Severity: normal | Resolution: fixed
Keywords: has-patch dev-feedback early | Focuses:
------------------------------------------+-----------------------------
Changes (by SergeyBiryukov):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"47769" 47769]:
{{{
#!CommitTicketReference repository="" revision="47769"
Script Loader: Add the `$group` parameter to `WP_Dependencies::do_item()`.
Previously, the method was called with two parameters in `::do_items()`,
while the method signature only included one parameter.
Technically, this was not an issue as `WP_Dependencies::do_item()` is a
placeholder meant to be overwritten when extending the class. When
handling scripts, `WP_Dependencies` is extended with `WP_Scripts`, and the
`$group` parameter was only used in `WP_Scripts::do_item()`, which does
expect a second argument.
However, officially adding the parameter to `WP_Dependencies::do_item()`
signature prevents code misunderstanding and avoids a warning in PHP code
inspection tools.
Props kaggdesign, soulseekah, azaozz, SergeyBiryukov.
Fixes #43627.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43627#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list