Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (5 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-admin/includes/class-wp-upgrader.php

    r47570 r47808  
    332332        if ( is_wp_error( $result ) ) {
    333333            $wp_filesystem->delete( $working_dir, true );
    334             if ( 'incompatible_archive' == $result->get_error_code() ) {
     334            if ( 'incompatible_archive' === $result->get_error_code() ) {
    335335                return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $result->get_error_data() );
    336336            }
     
    399399            if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {
    400400                // Attempt to alter permissions to allow writes and try again.
    401                 $wp_filesystem->chmod( $remote_destination . $filename, ( 'd' == $file_details['type'] ? FS_CHMOD_DIR : FS_CHMOD_FILE ) );
     401                $wp_filesystem->chmod( $remote_destination . $filename, ( 'd' === $file_details['type'] ? FS_CHMOD_DIR : FS_CHMOD_FILE ) );
    402402                if ( ! $wp_filesystem->is_writable( $remote_destination . $filename ) ) {
    403403                    $unwritable_files[] = $filename;
     
    604604
    605605        $destination_name = basename( str_replace( $local_destination, '', $destination ) );
    606         if ( '.' == $destination_name ) {
     606        if ( '.' === $destination_name ) {
    607607            $destination_name = '';
    608608        }
     
    745745
    746746            // Don't output the 'no signature could be found' failure message for now.
    747             if ( 'signature_verification_no_signature' != $download->get_error_code() || WP_DEBUG ) {
     747            if ( 'signature_verification_no_signature' !== $download->get_error_code() || WP_DEBUG ) {
    748748                // Output the failure error as a normal feedback, and not as an error.
    749749                $this->skin->feedback( $download->get_error_message() );
Note: See TracChangeset for help on using the changeset viewer.