#59619 closed defect (bug) (fixed)
Remove discouraged `@return void` annotations
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
Note:
@return void
should not be used outside of the default bundled themes.
There were a few PHP instances of @return void
added in 6.4, and other recent releases and thus violate that guideline.
Let's fix this throughout, except for themes (per the above), third-party libraries, and PHP compatibility code.
Also see relevant Gutenberg change for reference: https://github.com/WordPress/gutenberg/pull/55237
Change History (6)
This ticket was mentioned in PR #5484 on WordPress/wordpress-develop by @flixos90.
10 months ago
#1
- Keywords has-patch added; needs-patch removed
@flixos90 commented on PR #5484:
10 months ago
#2
Should the docs be updated to say that
@return void
is also allowed in third-party libraries and PHP compatibility code?
Great idea @tellthemachines! I've opened a PR in https://github.com/WordPress/wpcs-docs/pull/133.
@flixos90 commented on PR #5484:
10 months ago
#4
Committed in https://core.trac.wordpress.org/changeset/56943
#5
follow-up:
↓ 6
@
8 months ago
Just noticed that [56943] mentions three exceptions:
- bundled themes
- third-party libraries
- PHP compatibility shims.
That makes sense, but the documentation linked in this issue only mentions bundled themes.
I guess it's worth considering updating the documentation page accordingly?
#6
in reply to:
↑ 5
@
8 months ago
Replying to afercia:
That makes sense, but the documentation linked in this issue only mentions bundled themes.
I guess it's worth considering updating the documentation page accordingly?
I have already attempted that, see https://github.com/WordPress/wpcs-docs/pull/133. Looks like that PR needs a third opinion?
Trac ticket: https://core.trac.wordpress.org/ticket/59619