Skip to content

Commit 3c5cb60

Browse files
committed
Fix conditional logic
1 parent 556bf85 commit 3c5cb60

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/WP_CLI/SearchReplacer.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private function _run( $data, $serialised, $recursion_level = 0, $visited_data =
9090
}
9191
}
9292

93-
elseif ( $this->recurse_objects ) {
93+
elseif ( $this->recurse_objects && is_object( $data ) ) {
9494
if ( $data instanceof \__PHP_Incomplete_Class ) {
9595
$array = new ArrayObject( $data );
9696
\WP_CLI::warning(
@@ -99,10 +99,7 @@ private function _run( $data, $serialised, $recursion_level = 0, $visited_data =
9999
$array['__PHP_Incomplete_Class_Name']
100100
)
101101
);
102-
return $data;
103-
}
104-
105-
if ( is_object( $data ) ) {
102+
} else {
106103
foreach ( $data as $key => $value ) {
107104
$data->$key = $this->_run( $value, false, $recursion_level + 1, $visited_data );
108105
}

0 commit comments

Comments
 (0)