More than one anonymous class with trait is stopping the phpmd to finish
mvorisek opened this issue · comments
composer file used to install (latest) phpmd:
{
"require-dev": {
"phpmd/phpmd": "^2.13"
},
"require": {
"mi-schi/phpmd-extension": "^4.3"
}
}
Current Behavior
Trait method _ has not been applied, because there are collisions with other trait methods on Atk4\Core\Tests\Translator\AdapterAppTest.
Expected Behavior
phpmd finish
Steps To Reproduce:
- Install phpmd using the composer file above.
- Clone https://github.com/atk4/core.git
- Download https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/e42300456096ee5b5554cd0ea4552587b9667a48/phpmd.xml phpmd config
- run
php vendor/phpmd/phpmd/src/bin/phpmd core/ xml phpmd.xml
- notice the error message, phpmd does not finish (no formatted output)
The problem seems to be caused by a trait used in an anonymous, but different of course, class - https://github.com/atk4/core/blob/841e8059ec8/tests/Translator/AdapterAppTest.php#L20 - when one of that two anonymous classes are removed, phpmd can finish.
Very simillar problem is present with atk4/data repo here:
https://github.com/atk4/data/blob/06dc74732ab2f51/src/Persistence/Sql/DbalDriverMiddleware.php#L31-L46
in this case, the traits are not even the same