Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

stream_filter_append & stream_filter_prepend use mixed instead of array #395

Merged
merged 3 commits into from
Oct 7, 2022

Conversation

ildyria
Copy link
Contributor

@ildyria ildyria commented Sep 29, 2022

https://www.php.net/manual/en/function.stream-filter-append.php
Defines stream_filter_append as :

stream_filter_append(
    resource $stream,
    string $filtername,
    int $read_write = ?,
    [mixed](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.mixed) $params = ?
): resource

This PR aims to fix the inconsistency as here $params is defined as array.

Also updates https://www.php.net/manual/en/function.stream-filter-prepend.php

@Kharhamel
Copy link
Collaborator

You cannot directly update the generated files because the change will be lost the next time we will regenerate them. You need to update the generator instead.

To solve this, the simple solution is to edit this file: https://github.com/thecodingmachine/safe/blob/master/generator/config/CustomPhpStanFunctionMap.php
To make stream_filter_append return the type you want

@ildyria ildyria force-pushed the fix-stream-filter-append branch from 9c73c97 to 483b042 Compare October 1, 2022 20:40
@ildyria
Copy link
Contributor Author

ildyria commented Oct 1, 2022

@Kharhamel I updated as you advised.

@ildyria ildyria changed the title stream_filter_append use mixed instead of array stream_filter_append & stream_filter_prepend use mixed instead of array Oct 1, 2022
@Kharhamel Kharhamel merged commit e788f3d into thecodingmachine:master Oct 7, 2022
@Kharhamel
Copy link
Collaborator

Thank you for the MR. I will deploy this shortly

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants