Skip to content
Open
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions stubs/core.stub
Original file line number Diff line number Diff line change
Expand Up @@ -362,3 +362,16 @@ function header_register_callback(callable $callback): bool {}
* @param-later-invoked-callable $callback
*/
function register_tick_function(callable $callback, mixed ...$args): bool {}

/**
* @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
Copy link

@mvorisek mvorisek Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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.

*
* @return resource|false
*/
function proc_open($command, array $descriptor_spec, &$pipes, ?string $cwd, ?array $env_vars, ?array $options) {}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function proc_open($command, array $descriptor_spec, &$pipes, ?string $cwd, ?array $env_vars, ?array $options) {}
function proc_open($command, array $descriptor_spec, &$pipes, ?string $cwd = null, ?array $env_vars = null, ?array $options = null) {}

not sure if needed in stubs

Loading