From d65e514b7a146767c74352d7c3f25e489ed0d5b4 Mon Sep 17 00:00:00 2001 From: ildyria Date: Thu, 29 Sep 2022 20:49:19 +0200 Subject: [PATCH 1/3] stream_filter_append use mixed instead of array --- generated/stream.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generated/stream.php b/generated/stream.php index e1337210..5983dee7 100644 --- a/generated/stream.php +++ b/generated/stream.php @@ -73,7 +73,7 @@ function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0): * STREAM_FILTER_WRITE, and/or * STREAM_FILTER_ALL can also be passed to the * read_write parameter to override this behavior. - * @param array $params This filter will be added with the specified + * @param mixed $params This filter will be added with the specified * params to the end of * the list and will therefore be called last during stream operations. * To add a filter to the beginning of the list, use @@ -87,7 +87,7 @@ function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0): * @throws StreamException * */ -function stream_filter_append($stream, string $filtername, int $read_write = null, array $params = null) +function stream_filter_append($stream, string $filtername, int $read_write = null, mixed $params = null) { error_clear_last(); if ($params !== null) { From 483b04292cad3e3472fc6f0b71fa36ad178ed94a Mon Sep 17 00:00:00 2001 From: ildyria Date: Sat, 1 Oct 2022 22:40:32 +0200 Subject: [PATCH 2/3] With respect to comments. :) --- generated/curl.php | 11 ----------- generated/stream.php | 6 +++--- generator/config/CustomPhpStanFunctionMap.php | 2 ++ 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/generated/curl.php b/generated/curl.php index 3c135f0b..73a64d7f 100644 --- a/generated/curl.php +++ b/generated/curl.php @@ -3109,17 +3109,6 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): * * * - * CURLOPT_XFERINFOFUNCTION - * - * A callback accepting two parameters. - * Has a similar purpose as CURLOPT_PROGRESSFUNCTION but is more modern - * and the preferred option from cURL. - * - * - * Added in 7.32.0. Available as of PHP 8.2.0. - * - * - * * * * diff --git a/generated/stream.php b/generated/stream.php index 5983dee7..e025221c 100644 --- a/generated/stream.php +++ b/generated/stream.php @@ -87,7 +87,7 @@ function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0): * @throws StreamException * */ -function stream_filter_append($stream, string $filtername, int $read_write = null, mixed $params = null) +function stream_filter_append($stream, string $filtername, int $read_write = null, $params = null) { error_clear_last(); if ($params !== null) { @@ -123,7 +123,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul * read_write parameter to override this behavior. * See stream_filter_append for an example of * using this parameter. - * @param array $params This filter will be added with the specified params + * @param mixed $params This filter will be added with the specified params * to the beginning of the list and will therefore be * called first during stream operations. To add a filter to the end of the * list, use stream_filter_append. @@ -136,7 +136,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul * @throws StreamException * */ -function stream_filter_prepend($stream, string $filtername, int $read_write = null, array $params = null) +function stream_filter_prepend($stream, string $filtername, int $read_write = null, $params = null) { error_clear_last(); if ($params !== null) { diff --git a/generator/config/CustomPhpStanFunctionMap.php b/generator/config/CustomPhpStanFunctionMap.php index bd6c4b61..c8df05cf 100644 --- a/generator/config/CustomPhpStanFunctionMap.php +++ b/generator/config/CustomPhpStanFunctionMap.php @@ -38,4 +38,6 @@ 'fgetcsv' => ['array|false|null', 'fp'=>'resource', 'length='=>'0|positive-int', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'], //phpstan default return type is too hard to analyse //todo: edit the reader to turn 0|1 into int 'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'string[]', 'flags='=>'int', 'offset='=>'int'], //int|false instead of 0|1|false + 'stream_filter_prepend' => ['resource', 'stream' => 'resource', 'filtername' => 'string', 'read_write' => 'int', 'params' => 'mixed'], // params mixed instead of array + 'stream_filter_append' => ['resource', 'stream' => 'resource', 'filtername' => 'string', 'read_write' => 'int', 'params' => 'mixed'], // params mixed instead of array ]; From 27c2f28161f235243a1f80b61b14444b557a8c3d Mon Sep 17 00:00:00 2001 From: ildyria Date: Wed, 5 Oct 2022 12:56:26 +0200 Subject: [PATCH 3/3] curl produces different results on my machine... adding it back manually --- generated/curl.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/generated/curl.php b/generated/curl.php index 73a64d7f..3c135f0b 100644 --- a/generated/curl.php +++ b/generated/curl.php @@ -3109,6 +3109,17 @@ function curl_multi_setopt(\CurlMultiHandle $multi_handle, int $option, $value): * * * + * CURLOPT_XFERINFOFUNCTION + * + * A callback accepting two parameters. + * Has a similar purpose as CURLOPT_PROGRESSFUNCTION but is more modern + * and the preferred option from cURL. + * + * + * Added in 7.32.0. Available as of PHP 8.2.0. + * + * + * * * *