Skip to content

Commit e516414

Browse files
Avoid PHP deprecation notices in PHP 8.1.x (#5899)
1 parent a5e054e commit e516414

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

php/utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ function http_request( $method, $url, $data = null, $headers = [], $options = []
825825
if ( $halt_on_error ) {
826826
WP_CLI::error( $error_msg );
827827
}
828-
throw new RuntimeException( $error_msg, null, $exception );
828+
throw new RuntimeException( $error_msg, 0, $exception );
829829
}
830830

831831
$warning = sprintf(
@@ -846,7 +846,7 @@ function http_request( $method, $url, $data = null, $headers = [], $options = []
846846
if ( $halt_on_error ) {
847847
WP_CLI::error( $error_msg );
848848
}
849-
throw new RuntimeException( $error_msg, null, $exception );
849+
throw new RuntimeException( $error_msg, 0, $exception );
850850
}
851851
throw $exception;
852852
}

0 commit comments

Comments
 (0)