[wp-trac] [WordPress Trac] #37699: Death to Globals Episode #1: A Registry, A Pattern

WordPress Trac noreply at wordpress.org
Thu Sep 1 04:29:32 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 schlessera):

 Replying to [comment:60 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 validate it.

 This is not true, and as every major framework uses containers, PHPStorm
 has several ways of providing type inspection for them. For a very simple
 way of adding this, see the article here:
 https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37699#comment:63>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list