From f95e5ba5b65b8fe035b30f3a172b2f3379680e2a Mon Sep 17 00:00:00 2001 From: Mcsky Date: Fri, 13 Dec 2019 13:44:37 +0100 Subject: [PATCH] Add stream_set_option method with required structure. But without real implementations --- .../HttpClient/Response/StreamWrapper.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/Symfony/Component/HttpClient/Response/StreamWrapper.php b/src/Symfony/Component/HttpClient/Response/StreamWrapper.php index 59fd118e86e01..5faf047b2ade6 100644 --- a/src/Symfony/Component/HttpClient/Response/StreamWrapper.php +++ b/src/Symfony/Component/HttpClient/Response/StreamWrapper.php @@ -178,6 +178,28 @@ public function stream_read(int $count) return ''; } + public function stream_set_option(int $option, int $arg1, ?int $arg2): bool + { + if (null === $this->handle || 'stream' !== get_resource_type($this->handle)) { + trigger_error(sprintf('The "$handle" property of "%s" need to be a stream.', __CLASS__), E_USER_WARNING); + + return false; + } + + switch ($option) { + case STREAM_OPTION_BLOCKING: + return \stream_set_blocking($this->handle, $arg1); + case STREAM_OPTION_READ_TIMEOUT: + return \stream_set_timeout($this->handle, $arg1, $arg2); + case STREAM_OPTION_WRITE_BUFFER: + return \stream_set_write_buffer($this->handle, $arg1); + default: + trigger_error(sprintf('The option "%s" is unknown for "stream_set_option" method', $option), E_ERROR); + + return false; + } + } + public function stream_tell(): int { return $this->offset; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy