WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months 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-direct.php

    r47219 r47808  
    334334        $file = str_replace( '\\', '/', $file ); // For Win32, occasional problems deleting files otherwise.
    335335
    336         if ( 'f' == $type || $this->is_file( $file ) ) {
     336        if ( 'f' === $type || $this->is_file( $file ) ) {
    337337            return @unlink( $file );
    338338        }
     
    581581            $struc['name'] = $entry;
    582582
    583             if ( '.' == $struc['name'] || '..' == $struc['name'] ) {
     583            if ( '.' === $struc['name'] || '..' === $struc['name'] ) {
    584584                continue;
    585585            }
    586586
    587             if ( ! $include_hidden && '.' == $struc['name'][0] ) {
     587            if ( ! $include_hidden && '.' === $struc['name'][0] ) {
    588588                continue;
    589589            }
     
    604604            $struc['type']        = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';
    605605
    606             if ( 'd' == $struc['type'] ) {
     606            if ( 'd' === $struc['type'] ) {
    607607                if ( $recursive ) {
    608608                    $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
Note: See TracChangeset for help on using the changeset viewer.