Make WordPress Core

Opened 5 weeks ago

Last modified 12 days ago

#63272 reviewing enhancement

Remove redundant access tags from DocBlocks

Reported by: marian1's profile marian1 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.9 Priority: normal
Severity: trivial Version:
Component: General Keywords: has-patch
Focuses: docs Cc:

Description

A number of methods include an @access tag in their DocBlocks, even though the visibility is already declared in the function signature. These tags are redundant and add no new information.

I propose removing these tags to reduce redundancy and to align with the WordPress PHP Documentation Standards, which state that @access should be used only in limited circumstances — specifically, when visibility modifiers cannot be used in the code and only when referring to private visibility (e.g., for core-only functions or core classes implementing private APIs).

Change History (3)

This ticket was mentioned in PR #8684 on WordPress/wordpress-develop by @marian1.


5 weeks ago
#1

  • Keywords has-patch added

This patch removes @access tags from DocBlocks when the visibility is already defined in the method declaration. In such cases, the tags are redundant and do not provide additional value. This change is consistent with the WordPress PHP documentation standards.

This patch does not modify affected methods in WP_User_Search (which is deprecated), or in SimplePie_Decode_HTML_Entities, SimplePie\Parse\Date, and SimplePie\XML\Declaration\Parser.

Trac ticket: https://core.trac.wordpress.org/ticket/63272

#2 @SergeyBiryukov
12 days ago

  • Milestone changed from Awaiting Review to 6.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
12 days ago

In 60216:

Docs: Remove redundant @access tags from DocBlocks in some admin classes.

Since the affected methods already have the visibility declared in the function signature, these tags are unnecessary and add no new information.

Follow-up to [41612], [41821], [44961], [55971], [60198].

Props marian1.
See #63272.

Note: See TracTickets for help on using tickets.