-
-
Notifications
You must be signed in to change notification settings - Fork 741
Description
The bundled dependencies of the tool (vendor dir) are namespace prefixed to avoid conflicts. But nicik/php-parser package is not prefixed.
Example file:
vendor/nikic/php-parser/lib/PhpParser/NodeVisitor.php
In my project I am developing a custom rector rule, I run rector tests as a separate test suit, and then I get this conflict when trying to run my tests:
~\Desktop\BTA_projects\Mobile-App\rest-api\web git:[ONE-11888-clean-up-obsolete-code-parts-with-rector]
vendor/bin/phpunit --testdox --testsuite Rector
PHPUnit 12.3.0 by Sebastian Bergmann and contributors.
Runtime: PHP 8.4.7
Configuration: C:\Users\andrii.posternak\Desktop\BTA_projects\Mobile-App\rest-api\web\phpunit.xml
PHP Fatal error: Cannot redeclare interface PhpParser\NodeVisitor (previously declared in C:\Users\andrii.posternak\Desktop\BTA_projects\Mobile-App\rest-api\web\vendor\nikic\php-parser\lib\PhpParser\NodeVisitor.php:5) in C:\Users\andrii.posternak\Desktop\BTA_projects\Mobile-App\rest-api\web\vendor\rector\rector\vendor\nikic\php-parser\lib\PhpParser\NodeVisitor.php on line 6
Fatal error: Cannot redeclare interface PhpParser\NodeVisitor (previously declared in C:\Users\andrii.posternak\Desktop\BTA_projects\Mobile-App\rest-api\web\vendor\nikic\php-parser\lib\PhpParser\NodeVisitor.php:5) in C:\Users\andrii.posternak\Desktop\BTA_projects\Mobile-App\rest-api\web\vendor\rector\rector\vendor\nikic\php-parser\lib\PhpParser\NodeVisitor.php on line 6