[wp-trac] [WordPress Trac] #50767: Coding Standards fixes for WP 5.6

WordPress Trac noreply at wordpress.org
Sun Oct 18 17:44:18 UTC 2020


#50767: Coding Standards fixes for WP 5.6
--------------------------------------+-------------------------------
 Reporter:  SergeyBiryukov            |       Owner:  (none)
     Type:  task (blessed)            |      Status:  new
 Priority:  normal                    |   Milestone:  5.6
Component:  General                   |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  coding-standards
--------------------------------------+-------------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:11 jrf]:
 > The linked PR combines the four patches I just uploaded so we can see a
 passing build.

 Thanks for the patches!

 Re: [attachment:"50767-remove-assumption-in-code.patch"], looking at other
 instances of `$wpdb->get_row()` in core, the checks are not very
 consistent:
 * `is_object()`
 * `! empty()`
 * Just a truthy check, e.g. `if ( $result )`

 Should we bring some consistency to the other instances too? Since
 `$wpdb->get_row()` returns an object  by default, unless requested
 otherwise, I think a simple `if ( $signup )` or `if ( is_object( $signup )
 )` check would be enough here.

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


More information about the wp-trac mailing list