phpmd / phpmd

PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD. PHPMD can be seen as an user friendly frontend application for the raw metrics stream measured by PHP Depend.

Home Page:https://phpmd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. Install phpmd using the composer file above.
  2. Clone https://github.com/atk4/core.git
  3. Download https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/e42300456096ee5b5554cd0ea4552587b9667a48/phpmd.xml phpmd config
  4. run php vendor/phpmd/phpmd/src/bin/phpmd core/ xml phpmd.xml
  5. 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