Skip to content

v2 vendored phpmd issues with order of commands and also vendored_phpmd_path is ignored #6

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

Open
ulamthelucky opened this issue May 9, 2025 · 1 comment

Comments

@ulamthelucky
Copy link
Contributor

ulamthelucky commented May 9, 2025

There is a few observed issues:

  1. The vendor bin is fixed so using the vendored_phpmd_path - Path to a vendored phpmd binary option has no effect. This can obviously be worked around by just ensuring composer is run from the root of the project, but this option should either be removed or fixed so it works.

  2. the order of arguments is submitted wrong to phpmd:

Image

I am able to replicate this message by running phmd directly:

vendor/bin/phpmd server phpmd.xml github
Can't find the custom report class: phpmd.xml

If the order of the parameters is changed the problem is resolved:

$ vendor/bin/phpmd server/module/Application/src/Application/ text phpmd.xml
..... \server\module\Application\src\Application\Controller\ControllerListenerFactory.php:21 UnusedFormalParameter Avoid unused parameters such as '$requestedName'.

The order appears to require to be: binary, path, report format, ruleset or file

Version of phpmd:
PHPMD 2.15.0

@g105b
Copy link
Member

g105b commented May 12, 2025

Thanks for your issue. I'll address these points later and update the example project as a way of signing off the changes.

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