-
Notifications
You must be signed in to change notification settings - Fork 529
Added proc_open() stub for param-out #4261
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
base: 2.1.x
Are you sure you want to change the base?
Conversation
This pull request has been marked as ready for review. |
stubs/core.stub
Outdated
* @param string|array<string> $command | ||
* @param list<list<string>|resource> $descriptor_spec | ||
* @param array<resource> $pipes | ||
* @param array<mixed> $env_vars | ||
* @param array<string, bool> $options | ||
* | ||
* @param-out list<resource> $pipes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param string|array<string> $command | |
* @param list<list<string>|resource> $descriptor_spec | |
* @param array<resource> $pipes | |
* @param array<mixed> $env_vars | |
* @param array<string, bool> $options | |
* | |
* @param-out list<resource> $pipes | |
* @template P of int = int | |
* | |
* @param string|list<string> $command | |
* @param array<P, <list<string>|resource> $descriptor_spec | |
* @param array<string, mixed> $env_vars | |
* @param array<string, bool> $options | |
* | |
* @param-out array<P, resource> $pipes |
reasoning:
@template / $descriptor_spec / $pipes
$descriptor_spec
describes the pipes returned in $pipes
and in my understanding the keys always match.
$pipes
param-in type is not wanted as it can be anything, not only array, but also null/uninitialized variable. Like $matches
in preg_match
.
$env_vars
Only string keys should be allowed, as at least in bash keys cannot start with number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're closing an issue, please add a regression test for https://phpstan.org/r/dc1d4f91-b22d-4eaa-b796-34a353062477
(I don't think the issue is solved so that's why I'm asking for a test for the new behaviour) |
@ondrejmirtes test added. I think it works. |
closes phpstan/phpstan#13197