PHPUnit 9.x/10.x does not at all support named arguments from data-providers#250
PHPUnit 9.x/10.x does not at all support named arguments from data-providers#250ondrejmirtes merged 7 commits intophpstan:2.0.xfrom
Conversation
| yield [null]; // unknown phpunit version | ||
|
|
||
| if (PHP_VERSION_ID >= 80100) { | ||
| yield [10]; // PHPUnit 10.x requires PHP 8.1+ |
There was a problem hiding this comment.
hmm.. maybe we should even reflect this in PHPUnitVersion.
that way we could turn a maybe into a no depending on the php runtime version?
There was a problem hiding this comment.
I thought about it but probably no.
The only PHPUnit versions that support named arguments (in the sense they do not do array_values() on ...$args also only support PHP 8+.
The only wrong thing that can happen I think is when we're not successfully detecting PHPUnit version, and the user is running PHPUnit 11.5+ - we will produce Arg without names so possibly the result is going to be wrong.
But I don't think a condition about PHP version belongs to the logic. Because it's unrelated - you can run PHPUnit 9.x on PHP 8 as well...
|
Thank you! Let's update the extension in the phpstan-src PR to see if it's going to be green :) |
prevents phpstan-src errors we currently see on PHP 7.x:
refs phpstan/phpstan-src#4490 (comment)