Make WordPress Core

#63346 closed defect (bug) (fixed)

[Coding Standard]: Use self:: instead of class name for static member reference in WP_Http class

Reported by: dilipbheda Owned by: SergeyBiryukov
Priority: normal Milestone: 6.9
Component: HTTP API Version:
Severity: normal Keywords: has-patch
Cc: Focuses: coding-standards

Description

This issue proposes a minor refactor to improve code maintainability and ensure proper static context within the class.

Find the following PHPCS error:

phpcs: error
Squiz.Classes.SelfMemberReference.NotUsed - Must use "self::" for local static member reference

Current Code:

WP_Http::normalize_cookies( $parsed_args['cookies'] );

Proposed Change:

self::normalize_cookies( $parsed_args['cookies'] );

Change History (3)

This ticket was mentioned in ​PR #8739 on ​WordPress/wordpress-develop by ​@dilipbheda.


18 months ago
#1

#2 @SergeyBiryukov
18 months ago

  • Milestone Awaiting Review → 6.9

#3 @SergeyBiryukov
18 months ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 60191:

Coding Standards: Use self:: for static member reference in WP_Http.

This resolves a PHPCS error:

Squiz.Classes.SelfMemberReference.NotUsed - Must use "self::" for local static member reference

Follow-up to [20767], [37428], [38164].

Props dilipbheda.
Fixes #63346.

Note: See TracTickets for help on using tickets.