Make WordPress Core

Opened 15 years ago

Closed 13 years ago

Last modified 9 years ago

#11621 closed enhancement (fixed)

phpdoc/docblock improvements cache.php - global variables

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

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

Download all attachments as: .zip

Change History (14)

@hakre
15 years ago

#1 @hakre
15 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.

#2 follow-up: @Denis-de-Bernardy
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.

#3 @Denis-de-Bernardy
15 years ago

  • Milestone changed from Future Release to 3.0

#4 @Denis-de-Bernardy
15 years ago

  • Component changed from General to Inline Docs

#5 in reply to: ↑ 2 @nacin
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 @nacin
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.

#7 @hakre
15 years ago

@var is an exception, it's used in inline comments for do type hinting in the editor / IDE. PDT for example has that.

#8 @nacin
15 years ago

  • Keywords needs-patch added; has-patch dev-feedback removed

#9 @nacin
15 years ago

  • Milestone changed from 3.0 to Future Release

Inline docs -- needs new patch.

#10 @hakre
13 years ago

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

#11 @helenyhou
13 years ago

  • Milestone Future Release deleted

#12 @DrewAPicture
9 years ago

  • Keywords needs-patch removed
  • Milestone set to 4.4
  • Resolution changed from maybelater to fixed

[34225] added DocBlock-level @global comments for all of the functions/methods leveraging the $wp_object_cache global. Calling this fixed.

Note: See TracTickets for help on using tickets.