Closed aayla-secura closed 1 month ago
Hello @aayla-secura!
This is not really a software. We forked it because the original is abandoned.
I have no clue what is going on.
Try running it on a single file. e.g. vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsList.php
... maybe not on the distributed pkg but on the original source from https://github.com/Yoast/PHPUnit-Polyfills
Hi @szepeviktor and thank you for replying. I tried both: running it on a single test file (I tried with each one individually), and with the source repository. They are all blank... It works with other sources, but not these two that I pointed out, very bizarre.
In the checked out generator repo:
composer u
git clone git@github.com:Yoast/PHPUnit-Polyfills.git
bin/generate-stubs --out=testy.stubs PHPUnit-Polyfills/src/
generated a 38246 byte file
PHP 7.4
That is all I can do for you.
Hmm, ok, weird, I tried the same thing inside a php Docker image, in 3 different versions: 7.4.33, 8.3.12 and 8.4.0 (which is the one I have locally installed), and they all succeeded... So something else is causing it to fail on my machine, not the PHP version. I'll investigate more.
Thank you!
Please share your findings for the benefit of others.
Ok, I started with a clean composer project and installed php-stubs/generator. It was working to generate the stubs mentioned above. Then I installed yoast/phpunit-polyfills
into the project and it stopped working. Removed yoast/phpunit-polyfills
: working again... Somehow yoast/phpunit-polyfills
breaks it but I can't figure out how and why. But oh well, that's good enough for me!
Ah, so the autoloader that phpunitpolyfills-autoload.php
defines an for Yoast\PHPUnitPolyfills
classes is what breaks it? I don't really understand why, but also I don't have a clue about how the generator works 🙃 so perhaps this is an expected side effect.
I was trying to generate stubs today for
phpunit/phpunit
andyoast/phpunit-polyfills
and the resulting php stubs file is blank, even though the generator's report says it's found classes, etc. For example:but the output is blank:
Same with
vendor/phpunit/phpunit
... Am I using it in the wrong way?I'm using generator v0.8.4 with PHP 8.4