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. Built from https://develop.svn.wordpress.org/trunk@47808 git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -227,7 +227,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
fclose( $stream );
|
||||
|
||||
if ( $returnbool ) {
|
||||
return ( false === $data ) ? false : '' != trim( $data );
|
||||
return ( false === $data ) ? false : '' !== trim( $data );
|
||||
} else {
|
||||
return $data;
|
||||
}
|
||||
@@ -499,7 +499,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
public function delete( $file, $recursive = false, $type = false ) {
|
||||
if ( 'f' == $type || $this->is_file( $file ) ) {
|
||||
if ( 'f' === $type || $this->is_file( $file ) ) {
|
||||
return ssh2_sftp_unlink( $this->sftp_link, $file );
|
||||
}
|
||||
if ( ! $recursive ) {
|
||||
@@ -725,11 +725,11 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
$struc = array();
|
||||
$struc['name'] = $entry;
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] ) {
|
||||
if ( '.' === $struc['name'] || '..' === $struc['name'] ) {
|
||||
continue; // Do not care about these folders.
|
||||
}
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] ) {
|
||||
if ( ! $include_hidden && '.' === $struc['name'][0] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
$struc['time'] = gmdate( 'h:i:s', $struc['lastmodunix'] );
|
||||
$struc['type'] = $this->is_dir( $path . '/' . $entry ) ? 'd' : 'f';
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( 'd' === $struc['type'] ) {
|
||||
if ( $recursive ) {
|
||||
$struc['files'] = $this->dirlist( $path . '/' . $struc['name'], $include_hidden, $recursive );
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user