Make WordPress Core

Opened 17 years ago

Closed 15 years ago

Last modified 11 years ago

#11621 closed enhancement (fixed)

phpdoc/docblock improvements cache.php - global variables

Reported by: hakre Owned by:
Priority: normal Milestone: 4.4
Component: Inline Docs Version: 2.9
Severity: normal Keywords:
Cc: Focuses:

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 17 years ago.
11621.diff​ (4.1 KB ) - added by Denis-de-Bernardy 17 years ago.

Download all attachments as: .zip

Change History (14)

#1 @hakre
17 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
17 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
17 years ago

  • Milestone Future Release → 3.0

#4 @Denis-de-Bernardy
17 years ago

  • Component General → Inline Docs

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

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

#9 @nacin
17 years ago

  • Milestone 3.0 → Future Release

Inline docs -- needs new patch.

#10 @hakre
15 years ago

  • Resolution → maybelater
  • Status new → closed

#11 @helenyhou
15 years ago

  • Milestone Future Release

#12 @DrewAPicture
11 years ago

  • Keywords needs-patch removed
  • Milestone → 4.4
  • Resolution maybelater → 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.