[php-src] Issue #9897: declare `param-out` in stubs
| From: | staabm | Date: | Sun, 06 Nov 2022 08:20:41 +0000 |
| Subject: | [php-src] Issue #9897: declare `param-out` in stubs | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242756@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9897
Author: staabm
### Description
since [phpstan 1.9 support for
@param-out phpdoc was
added](https://phpstan.org/blog/phpstan-1-9-0-with-phpdoc-asserts-list-type#parameter-type-assigned-by-reference).
[psalm supports
it](https://psalm.dev/docs/annotating_code/supported_annotations/#param-out-psalm-param-out) for a
longer time.
it would be great if the php-src stub files could annotate the sources with @param-out
when the types a parameter manipulated by referenced are known. that way the tools could consume the
types, without the need to maintain such list in all tools redundantly.
one example is e.g. https://github.com/php/php-src/blob/02ed12240ede3c012faab5c9dda759c0cc45969f/ext/curl/curl.stub.php#L3598-L3603