[wp-trac] [WordPress Trac] #44395: PHPCS: Assignment must be the first block of code on a line

WordPress Trac noreply at wordpress.org
Mon Jun 18 14:24:10 UTC 2018


#44395: PHPCS: Assignment must be the first block of code on a line
----------------------------------------------+----------------------------
 Reporter:  subrataemfluence                  |      Owner:  (none)
     Type:  enhancement                       |     Status:  new
 Priority:  normal                            |  Milestone:  Awaiting
                                              |  Review
Component:  General                           |    Version:
 Severity:  normal                            |   Keywords:  has-patch
  Focuses:  administration, coding-standards  |
----------------------------------------------+----------------------------
 File: /wp-admin/custom-background.php
 Line number: 259

 Code block as of now:

 {{{#!php
 <?php
 if ( $bgcolor = get_background_color() ) {
    $background_styles .= 'background-color: #' . $bgcolor . ';';
 }
 }}}

 Modified code:

 {{{#!php
 <?php
 $bgcolor = get_background_color();
 if ( '' !== $bgcolor ) {
    $background_styles .= 'background-color: #' . $bgcolor . ';';
 }
 }}}



 Please let me know if the proposed patch works.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44395>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list