Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than one anonymous class with trait is stopping the phpmd to finish #1009

Open
mvorisek opened this issue Jun 7, 2023 · 1 comment
Open

Comments

@mvorisek
Copy link

mvorisek commented Jun 7, 2023

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.

@mvorisek
Copy link
Author

mvorisek commented Jun 7, 2023

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

@ravage84 ravage84 added this to the 2.x (unspecific) milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants