From 0fb5e7f0c79ba5c0b27f7ea6acc7423fac790c90 Mon Sep 17 00:00:00 2001 From: Fab Stz Date: Fri, 7 Feb 2025 14:11:00 +0100 Subject: [PATCH] fix deprecation error on PHP 8.3 on stream_context_set_options() "Calling stream_context_set_option() with 2 arguments is deprecated, use stream_context_set_options() instead" at vendor/datto/json-rpc-http/src/Client.php:223 --- src/Client.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index ca58357..f0849a2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -220,7 +220,14 @@ public function send() try { $options = $this->getStreamOptions(); - stream_context_set_option($this->context, $options); + if (PHP_VERSION_ID >= 80300) + { + stream_context_set_options($this->context, $options); + } + else + { + stream_context_set_option($this->context, $options); + } $message = file_get_contents($this->uri, false, $this->context); $this->throwHttpExceptionOnHttpError($http_response_header);