Skip to content

Commit d9b54ef

Browse files
authored
Merge pull request #102 from jrfnl/feature/cs-fixes-4
PHPCS: fix up the code base [4] - yoda conditions
2 parents e2e79b7 + 767c204 commit d9b54ef

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Search_Replace_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ private function write_sql_row_fields( $table, $rows ) {
595595
// $index % $export_insert_size == 0 && $index > 0
596596
// 2. Or when the loop is running last time
597597
// $index == $count
598-
if ( ( $index % $export_insert_size === 0 && $index > 0 ) || $index === $count ) {
598+
if ( ( 0 === $index % $export_insert_size && $index > 0 ) || $index === $count ) {
599599
$sql .= ";\n";
600600

601601
if ( method_exists( $wpdb, 'remove_placeholder_escape' ) ) {

src/WP_CLI/SearchReplacer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private function _run( $data, $serialised, $recursion_level = 0, $visited_data =
6868
if ( $this->recurse_objects ) {
6969

7070
// If we've reached the maximum recursion level, short circuit
71-
if ( $this->max_recursion !== 0 && $recursion_level >= $this->max_recursion ) {
71+
if ( 0 !== $this->max_recursion && $recursion_level >= $this->max_recursion ) {
7272
return $data;
7373
}
7474

@@ -82,7 +82,7 @@ private function _run( $data, $serialised, $recursion_level = 0, $visited_data =
8282
}
8383
}
8484

85-
if ( is_string( $data ) && ( $unserialized = @unserialize( $data ) ) !== false ) {
85+
if ( is_string( $data ) && false !== ( $unserialized = @unserialize( $data ) ) ) {
8686
$data = $this->_run( $unserialized, true, $recursion_level + 1 );
8787
} elseif ( is_array( $data ) ) {
8888
$keys = array_keys( $data );

0 commit comments

Comments
 (0)