Make WordPress Core

#57206 closed defect (bug) (fixed)

Incorrect doc type for `_WP_Dependency::$src`

Reported by: swissspidy's profile swissspidy Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.2 Priority: low
Severity: trivial Version: 5.5
Component: Script Loader Keywords: good-first-bug has-patch commit
Focuses: Cc:

Description

When using wp_register_script with $src set to false, it means the item is an alias of other items it depends on.

Thus, it's possible for the _WP_Dependency object to have a $src that's not a string. This should be reflected in the docblock.

/**
 * The handle source.
 *
 * @since 2.6.0
 * @var string|false
 */
public $src;

Attachments (1)

57206.diff (374 bytes) - added by mehulkaklotar 20 months ago.

Download all attachments as: .zip

Change History (4)

#1 @mehulkaklotar
20 months ago

  • Keywords has-patch added; needs-patch removed

#2 @costdev
20 months ago

  • Keywords commit added
  • Milestone changed from Future Release to 6.2
  • Version set to 5.5

[48462] documented $src as string, but did not include the false type.

Patch 57206.diff looks good to me - Thanks @mehulkaklotar!

Milestoning for 6.2 and adding for commit consideration.

#3 @SergeyBiryukov
20 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 54875:

Docs: Correct the type for _WP_Dependency::$src property.

The handle source can be set to false, which means the item is an alias of other items it depends on.

Follow-up to [7970], [25518], [43661], [47170], [48462], [54470].

Props mehulkaklotar, swissspidy, costdev.
Fixes #57206.

Note: See TracTickets for help on using tickets.