Skip to content

Add "base64" as key for stream_get_meta_data #369

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 7, 2020

Conversation

SvenRtbg
Copy link
Contributor

@SvenRtbg SvenRtbg commented Nov 4, 2020

Given the right "data" url, PHP will add a boolean "base64" key to stream_get_meta_data.

See some example code in action: https://3v4l.org/G65j4

Given the right "data" url, PHP will add a boolean "base64" key to `stream_get_meta_data`.

See some example code in action: https://3v4l.org/G65j4
@ondrejmirtes
Copy link
Member

Hi, the key should be marked as optional.

@SvenRtbg
Copy link
Contributor Author

SvenRtbg commented Nov 5, 2020

I'd like to if I knew how to. I am using the same format as "mediatype", which has been added years ago when this file was at a different location, and it also isn't marked as optional.

I found that arguments can be marked as optional using = as a suffix, but we are talking about the return value here.

@ondrejmirtes
Copy link
Member

https://phpstan.org/writing-php-code/phpdoc-types#array-shapes

See for example unserialize.

@ondrejmirtes ondrejmirtes merged commit c4231eb into phpstan:master Nov 7, 2020
@ondrejmirtes
Copy link
Member

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants