#11621 closed enhancement (fixed)
phpdoc/docblock improvements cache.php - global variables
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 2.9 |
Component: | Inline Docs | Keywords: | |
Focuses: | 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 (14)
#2
follow-up:
↓ 5
@
15 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.
#5
in reply to:
↑ 2
@
15 years ago
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..
#6
@
15 years ago
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.
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.