Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik
Copy link
Member Author

@TomasVotruba this PR demonstrate error:

There was 1 error:

1) Rector\RectorCompatTests\Tests\Rector\MakeClassFinalRector\UsePHPParser4Test::test
Error: Call to undefined method PhpParser\ParserFactory::create()

by require nikic/php-parser 4 and phpunit 10.

The PR to solve this is at PR:

Now, built on dev-main, let's try merge this and see if on main branch works ok 👍

@samsonasik samsonasik merged commit 2f6ca92 into main Oct 14, 2025
3 of 4 checks passed
@samsonasik samsonasik deleted the add-test-phpunit-10 branch October 14, 2025 11:20
@samsonasik
Copy link
Member Author

@samsonasik
Copy link
Member Author

@TomasVotruba the issue is it seems try to load phpstan phar:

$r = new ReflectionClass(\PhpParser\ParserFactory::class);
var_dump($r->getFileName());

got:

phar:///prj/rector-compat-tests/vendor/phpstan/phpstan/phpstan.phar/vendor/nikic/php-parser/lib/PhpParser/ParserFactory.php

which we use nikic/php-parser 5.x already, so the error is actually expected.

I will just revert this, as this seems expected when using rector 2.x, phpstan used is 2.x, and php-parser is 5.x.

The patch is actually valid before phpunit 12 tho :), for phpunit < 12

on different issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants