Skip to content

Commit e788f3d

Browse files
authored
Merge pull request #395 from ildyria/fix-stream-filter-append
stream_filter_append & stream_filter_prepend use mixed instead of array
2 parents 0c5bae9 + 27c2f28 commit e788f3d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

generated/stream.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function stream_copy_to_stream($from, $to, int $length = null, int $offset = 0):
7373
* STREAM_FILTER_WRITE, and/or
7474
* STREAM_FILTER_ALL can also be passed to the
7575
* read_write parameter to override this behavior.
76-
* @param array $params This filter will be added with the specified
76+
* @param mixed $params This filter will be added with the specified
7777
* params to the end of
7878
* the list and will therefore be called last during stream operations.
7979
* 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):
8787
* @throws StreamException
8888
*
8989
*/
90-
function stream_filter_append($stream, string $filtername, int $read_write = null, array $params = null)
90+
function stream_filter_append($stream, string $filtername, int $read_write = null, $params = null)
9191
{
9292
error_clear_last();
9393
if ($params !== null) {
@@ -123,7 +123,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul
123123
* read_write parameter to override this behavior.
124124
* See stream_filter_append for an example of
125125
* using this parameter.
126-
* @param array $params This filter will be added with the specified params
126+
* @param mixed $params This filter will be added with the specified params
127127
* to the beginning of the list and will therefore be
128128
* called first during stream operations. To add a filter to the end of the
129129
* list, use stream_filter_append.
@@ -136,7 +136,7 @@ function stream_filter_append($stream, string $filtername, int $read_write = nul
136136
* @throws StreamException
137137
*
138138
*/
139-
function stream_filter_prepend($stream, string $filtername, int $read_write = null, array $params = null)
139+
function stream_filter_prepend($stream, string $filtername, int $read_write = null, $params = null)
140140
{
141141
error_clear_last();
142142
if ($params !== null) {

generator/config/CustomPhpStanFunctionMap.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838
'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
3939
//todo: edit the reader to turn 0|1 into int
4040
'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_subpatterns='=>'string[]', 'flags='=>'int', 'offset='=>'int'], //int|false instead of 0|1|false
41+
'stream_filter_prepend' => ['resource', 'stream' => 'resource', 'filtername' => 'string', 'read_write' => 'int', 'params' => 'mixed'], // params mixed instead of array
42+
'stream_filter_append' => ['resource', 'stream' => 'resource', 'filtername' => 'string', 'read_write' => 'int', 'params' => 'mixed'], // params mixed instead of array
4143
];

0 commit comments

Comments
 (0)