#11621 closed enhancement (maybelater)
phpdoc/docblock improvements cache.php - global variables
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Inline Docs | Version: | 2.9 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
While going through source I stumbeled over docblocks in cache.php. Since I did something similar within some other parts of the core some time ago I wanted to evolve it a bit and went through the docblocks regarding global variable usage.
Please see it as a suggestion. I think the source pretty much speaks for itself. I've made this based on the documentation here:
Document a global variable, or its use in a function/method (phpDocumentor Manual)
Attachments (2)
Change History (13)
Denis-de-Bernardy — 3 years ago
comment:2
follow-up:
↓ 5
Denis-de-Bernardy — 3 years ago
new patch builds upon the existing one, and strips the global's initialization. imo that ought to be the job for wp_cache_init(), in case the variable is already initialized by a cache plugin.
- Milestone changed from Future Release to 3.0
- Component changed from General to Inline Docs
Replying to Denis-de-Bernardy:
new patch builds upon the existing one, and strips the global's initialization. imo that ought to be the job for wp_cache_init(), in case the variable is already initialized by a cache plugin.
Doesn't look like you have that in your patch..
Ok, didn't see that you were pulling it out of the initial patch.
You can't include phpdoc inside of a function, it doesn't work. Other changes look okay though, but in order for @global to work, the global needs to be documented elsewhere. Otherwise you need to specify $GLOBALSvar?. The link in the ticket description explains this.
@var is an exception, it's used in inline comments for do type hinting in the editor / IDE. PDT for example has that.
- Milestone changed from 3.0 to Future Release
Inline docs -- needs new patch.
comment:10
hakre — 15 months ago
- Resolution set to maybelater
- Status changed from new to closed
comment:11
helenyhou — 15 months ago
- Milestone Future Release deleted

I actually need a core-devs statement on how to docblock-handle those globals. I would like to see that in, because my IDE does support code completition then an I think it will other developers as well.