WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 21 months ago

Last modified 13 months ago

#42803 closed enhancement (fixed)

Remove @static tags from core DocBlocks

Reported by: birgire Owned by:
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch commit
Focuses: docs, coding-standards Cc:
PR Number:

Description

This ticket is for the removal of the @static tag from core docblocks but not the @staticvar tag for static variables.

The @static tag is redundant and similar has been done regarding the @access tag in #41452.

Also see the comment by @DrewAPicture in ticket:41401#comment:2

The PHPDocumentator mentions that @static was a helpful tag in PHP-4 but isn't needed for static keyword usage in PHP-5.

Attachments (2)

42803-wp-admin.diff (3.9 KB) - added by birgire 2 years ago.
The wp-admin/* classes
42803-wp-includes-wp-content.diff (29.9 KB) - added by birgire 2 years ago.
The wp-includes/* and wp-content/* classes

Download all attachments as: .zip

Change History (14)

@birgire
2 years ago

The wp-admin/* classes

@birgire
2 years ago

The wp-includes/* and wp-content/* classes

#1 @birgire
2 years ago

  • Keywords has-patch dev-feedback added

42803-wp-admin.diff is for the relevant .php files in wp-admin/*.

42803-wp-includes-wp-content.diff is for the relevant .php files in wp-includes/* and wp-content/*. It skips these vendor files:

  • wp-includes/class-phpmailer.php
  • wp-includes/Text/Diff.php
  • wp-includes/SimplePie/Misc.php

Hopefully this covers it.

#2 @netweb
2 years ago

  • Keywords commit added; dev-feedback removed
  • Milestone changed from Awaiting Review to 5.0

Looks good to me

#3 @GaryJ
2 years ago

  • Focuses coding-standards added

#4 @SergeyBiryukov
21 months ago

In 42745:

Docs: Remove @static notations from method DocBlocks in wp-admin/* classes.

This tag has been used in the past, but should no longer be used. Just using the static keyword in code is enough for PhpDocumentor on PHP5+ to recognize static variables and methods, and PhpDocumentor will mark them as static.

Props birgire.
See #42803.

#5 @SergeyBiryukov
21 months ago

In 42746:

Docs: Remove @static notations from method DocBlocks in wp-includes/* classes.

This tag has been used in the past, but should no longer be used. Just using the static keyword in code is enough for PhpDocumentor on PHP5+ to recognize static variables and methods, and PhpDocumentor will mark them as static.

Props birgire.
See #42803.

#6 @SergeyBiryukov
21 months ago

In 42747:

Docs: Remove @static notations from property DocBlocks in wp-admin/* and wp-includes/* classes.

This tag has been used in the past, but should no longer be used. Just using the static keyword in code is enough for PhpDocumentor on PHP5+ to recognize static variables and methods, and PhpDocumentor will mark them as static.

Props birgire.
See #42803.

#7 @SergeyBiryukov
21 months ago

In 42749:

Twenty Fourteen: Remove redundant @access and @static notations from classes.

Props birgire.
See #41452, #42803, #42505.

#8 @SergeyBiryukov
21 months ago

In 42751:

Docs: Remove erroneous @static notation from WP_Http::_dispatch_request(), added in [32650].

The method was never user as static.

Props birgire.
See #42803.

#9 @SergeyBiryukov
21 months ago

In 42752:

Docs: Remove erroneous @static notation from WP_Tax_Query::get_sql(), added in [32627].

The method was never used as static.

Props birgire.
See #42803.

#10 @SergeyBiryukov
21 months ago

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

The only instance left is MO::make_entry() in wp-includes/pomo/mo.php.

Looks like it was never used as static in core, though could potentially be called as static. MO::get_byteorder(), on the other hand, is used as static, but is not marked as such.

The whole POMO library does not have access modifiers (it was skipped in #22234, see comment:16:ticket:22234). We could probably reconsider it, but let's do that in a new ticket.

#12 @johnbillion
13 months ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.