Opened 3 years ago

Closed 15 months ago

Last modified 15 months ago

#11621 closed enhancement (maybelater)

phpdoc/docblock improvements cache.php - global variables

Reported by: hakre 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)

11621.patch (4.5 KB) - added by hakre 3 years ago.
11621.diff (4.1 KB) - added by Denis-de-Bernardy 3 years ago.

Download all attachments as: .zip

Change History (13)

hakre3 years ago

  • Keywords dev-feedback added

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.

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

comment:5 in reply to: ↑ 2   nacin3 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..

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.

  • Keywords needs-patch added; has-patch dev-feedback removed
  • Milestone changed from 3.0 to Future Release

Inline docs -- needs new patch.

  • Resolution set to maybelater
  • Status changed from new to closed
  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.