[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern
WordPress Trac
noreply at wordpress.org
Thu Sep 1 02:16:14 UTC 2016
#37699: Death to Globals Episode #1: A Registry, A Pattern
----------------------------+------------------
Reporter: wonderboymusic | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.7
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
----------------------------+------------------
Comment (by MikeSchinkel):
I have real concerns with using `WP::get()`, e.g. `WP::get('wpdb')`:
1. There is no way to type the return value thus coding with an IDE like
PhpStorm will result in code that is littered with flagged unresolvable
references.
2. This simple issue that `WP::get('wdpb')` won't get cause during
development in an IDE like PhpStorm because it can't inspect the string
and associate it with the `wpdb` class.
Propose instead using `WP::<global>()` and `WP::set_<global>()` as in
`WP::wpdb()` and `WP::set_wpdb()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37699#comment:60>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list