Make WordPress Core

#63272 closed enhancement (fixed)

Remove redundant access tags from DocBlocks

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

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

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


19 months 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
19 months ago

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

#3 @SergeyBiryukov
19 months 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.

#4 @SergeyBiryukov
17 months ago

  • Resolution → fixed
  • Status reviewing → closed

In 60325:

Docs: Remove redundant @access tags from DocBlocks in various files.

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 [41590], [48159], [56052].

Props marian1.
Fixes #63272.

Note: See TracTickets for help on using tickets.