Make WordPress Core


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

    r47584 r47808  
    228228
    229229                        if ( $returnbool ) {
    230                                 return ( false === $data ) ? false : '' != trim( $data );
     230                                return ( false === $data ) ? false : '' !== trim( $data );
    231231                        } else {
    232232                                return $data;
     
    500500         */
    501501        public function delete( $file, $recursive = false, $type = false ) {
    502                 if ( 'f' == $type || $this->is_file( $file ) ) {
     502                if ( 'f' === $type || $this->is_file( $file ) ) {
    503503                        return ssh2_sftp_unlink( $this->sftp_link, $file );
    504504                }
     
    726726                        $struc['name'] = $entry;
    727727
    728                         if ( '.' == $struc['name'] || '..' == $struc['name'] ) {
     728                        if ( '.' === $struc['name'] || '..' === $struc['name'] ) {
    729729                                continue; // Do not care about these folders.
    730730                        }
    731731
    732                         if ( ! $include_hidden && '.' == $struc['name'][0] ) {
     732                        if ( ! $include_hidden && '.' === $struc['name'][0] ) {
    733733                                continue;
    734734                        }
     
    749749                        $struc['type']        = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';
    750750
    751                         if ( 'd' == $struc['type'] ) {
     751                        if ( 'd' === $struc['type'] ) {
    752752                                if ( $recursive ) {
    753753                                        $struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
Note: See TracChangeset for help on using the changeset viewer.