[wp-trac] [WordPress Trac] #43405: CS: Fix violations for wp-signup.php

WordPress Trac noreply at wordpress.org
Tue Jan 15 09:22:14 UTC 2019


#43405: CS: Fix violations for wp-signup.php
--------------------------+------------------------------------------
 Reporter:  GaryJ         |       Owner:  jrf
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  5.1
Component:  Users         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  multisite, coding-standards
--------------------------+------------------------------------------

Comment (by jrf):

 @desrosj I've given it a once-over. LGTM, just two remarks:

 1. The condition on line 925/939 is still hard to read and confusing for
 people who don't know operator precedence well enough by heart.
 Suggested alternative:
 {{{#!php
 <?php
 if ( 'all' === $active_signup
     || ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup )
     || ( 'user' === $_POST['signup_for'] && 'user' === $active_signup )
 ) {
     // Code
 }
 }}}


 2. FYI/For future reference: it's likely that we'll be moving away from
 Yoda conditions in the near future, see https://github.com/WordPress-
 Coding-Standards/WordPress-Coding-Standards/issues/1624, but as that
 hasn't been actioned yet, that shouldn't influence this patch.

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


More information about the wp-trac mailing list