[wp-trac] [WordPress Trac] #23357: PSR compatibility

WordPress Trac noreply at wordpress.org
Fri Feb 1 15:02:29 UTC 2013


#23357: PSR compatibility
-------------------------+------------------------------
 Reporter:  fale         |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  close        |
-------------------------+------------------------------
Changes (by rmccue):

 * keywords:   => close


Comment:

 PSR-0 would be nice, and can probably be done without breakage, but
 autoloading is not something that the core team wants to do for
 performance reasons (from memory). Also as nacin mentioned in #21300, we
 require PHP 5.2 which can have SPL disabled.

 PSR-1 requires PSR-0, plus requires some major refactoring in places to
 avoid "Files SHOULD either declare symbols (classes, functions, constants,
 etc.) or cause side-effects (e.g. generate output, change .ini settings,
 etc.) but SHOULD NOT do both." (Such as default actions/filters). In
 addition, "Method names MUST be declared in camelCase" goes against the
 well-defined WordPress coding standards.

 PSR-2 uses spaces instead of tabs, something I personally hate and
 something that goes against the WP standards. Likewise for braces and
 mostly everything. This is the least likely to get adopted.

 PSR-3 is somewhat useless, since WP does no logging internally apart from
 the standard PHP `error_log()`. All errors are passed as `WP_Error`
 objects, similar to exceptions.

 ----

 While it would be nice, and I'm the first to agree that WP shouldn't be a
 silo (I believe I'm the only active person on the PSR and php-internals
 mailing lists that can talk about WP), it's realistically not going to
 happen. Most of it would be against existing coding standards which WP
 developers are well aware of, and cause huge backwards compatibility
 breakage. I can see us moving possibly towards PSR-0, but the others don't
 seem like they're that useful.

 It breaks my heart to say, but: not going to happen, so recommending
 wontfix.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23357#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list