Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (4 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-filesystem-base.php

    r47557 r47808  
    9999
    100100        // Account for relative theme roots.
    101         if ( '/themes' == $theme_root || ! is_dir( $theme_root ) ) {
     101        if ( '/themes' === $theme_root || ! is_dir( $theme_root ) ) {
    102102            $theme_root = WP_CONTENT_DIR . $theme_root;
    103103        }
     
    209209                }
    210210            }
    211         } elseif ( 'direct' == $this->method ) {
     211        } elseif ( 'direct' === $this->method ) {
    212212            $folder = str_replace( '\\', '/', $folder ); // Windows path sanitisation.
    213213            return trailingslashit( $folder );
     
    246246     */
    247247    public function search_for_folder( $folder, $base = '.', $loop = false ) {
    248         if ( empty( $base ) || '.' == $base ) {
     248        if ( empty( $base ) || '.' === $base ) {
    249249            $base = trailingslashit( $this->cwd() );
    250250        }
     
    306306        // Prevent this function from looping again.
    307307        // No need to proceed if we've just searched in `/`.
    308         if ( $loop || '/' == $base ) {
     308        if ( $loop || '/' === $base ) {
    309309            return false;
    310310        }
Note: See TracChangeset for help on using the changeset viewer.