Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user.php

    r47550 r47808  
    193193                }
    194194
    195                 if ( 'id' == $field ) {
     195                if ( 'id' === $field ) {
    196196                        // Make sure the value is numeric to avoid casting objects, for example,
    197197                        // to int 1.
    … …  
    264264         */
    265265        public function __isset( $key ) {
    266                 if ( 'id' == $key ) {
     266                if ( 'id' === $key ) {
    267267                        _deprecated_argument(
    268268                                'WP_User->id',
    … …  
    297297         */
    298298        public function __get( $key ) {
    299                 if ( 'id' == $key ) {
     299                if ( 'id' === $key ) {
    300300                        _deprecated_argument(
    301301                                'WP_User->id',
    … …  
    338338         */
    339339        public function __set( $key, $value ) {
    340                 if ( 'id' == $key ) {
     340                if ( 'id' === $key ) {
    341341                        _deprecated_argument(
    342342                                'WP_User->id',
    … …  
    363363         */
    364364        public function __unset( $key ) {
    365                 if ( 'id' == $key ) {
     365                if ( 'id' === $key ) {
    366366                        _deprecated_argument(
    367367                                'WP_User->id',
Note: See TracChangeset for help on using the changeset viewer.