- What is irstea/phpmd-config and is it a Laravel package?
- irstea/phpmd-config is a curated PHPMD ruleset.xml that configures PHP Mess Detector with opinionated complexity, design, unused-code, and naming thresholds. It is not a Laravel package in the usual sense: there is no service provider, no autoloaded PHP classes, and no runtime integration with the framework. It is a configuration artifact you point PHPMD at in Laravel or plain PHP projects.
- How do I install irstea/phpmd-config with Composer?
- The package is distributed from an IRSTEA GitLab repository rather than Packagist, so a normal composer require will not find it. You would add a VCS repositories entry pointing at the GitLab URL and configure access with deploy keys or a token, then require the package. Because the payload is essentially one XML file, many teams simply vendor the ruleset into their project instead of wiring up credentials.
- Can I use irstea/phpmd-config without adding it as a Composer dependency?
- Yes. Since the useful content is a single ruleset.xml file, the cleanest integration is often to copy it into your repository, for example at tools/phpmd/phpmd.xml. You then run vendor/bin/phpmd app,src text tools/phpmd/phpmd.xml --exclude vendor,tests/fixtures as a Composer script or CI step. Vendoring avoids giving every workstation and CI runner a live credential dependency on an external GitLab host.
- Does irstea/phpmd-config work with Laravel 10, Laravel 11, and PHP 8.x?
- There is no Laravel version constraint because the package does not enter the application runtime or autoload graph. The practical compatibility question is which PHPMD version the ruleset was validated against, since newer PHPMD releases can reject unknown or removed rule references. Check the ruleset contents and the PHPMD version in your project before rolling it out.
- How do I run this PHPMD ruleset in a CI pipeline?
- Install PHPMD as a dev dependency, make the ruleset available in the repository, and add a pipeline step such as vendor/bin/phpmd app,src text tools/phpmd/phpmd.xml --exclude vendor,tests/fixtures. Wire it as a Composer script so local runs and CI use the same command and thresholds. Keep the ruleset file pinned in version control so builds remain reproducible.
- Can I override the thresholds in irstea/phpmd-config?
- Yes. The ruleset is XML, so you can copy it into your project and edit rule refs, properties, and thresholds to match your team's standards. The package is described as publishable and customisable, but in practice you are editing a configuration file rather than extending framework behaviour. Keep your local copy under version control and review changes deliberately.
- What rules does the irstea/phpmd-config ruleset include?
- The overview describes a curated ruleset tuned for real-world PHP and Laravel codebases, with sensible thresholds for cyclomatic complexity, method length, naming, design, and unused code. It does not spell out every rule name or numeric threshold in the metadata, so inspect ruleset.xml before adopting it. If the XML uses rule refs into external rulesets, those transitive dependencies must also be available.
- Is the ruleset suitable for production, and is it licensed for reuse?
- It has no runtime footprint, so production risk is limited to your build and quality-gate process. The bigger concerns are supply chain and licensing: the package is hosted on an institute-controlled GitLab, has no declared license in the metadata, and may have no release tags. Treat it as all rights reserved until the license and redistribution posture are confirmed, and consider an internal mirror or vendored copy.
- Does irstea/phpmd-config replace PHPStan, Larastan, or Laravel Pint?
- No. PHPMD focuses on complexity and design smells such as cyclomatic complexity, NPath, coupling, and unused code, which are areas PHPStan and Larastan cover poorly. Pint handles code style and PSR-12 formatting, so a PHPMD ruleset can overlap with naming or style checks and create duplicate noise. Use it as an optional third quality gate alongside your existing static analysis and formatter.
- How do I avoid false positives and stale-rule failures with this ruleset?
- The thresholds were tuned for IRSTEA's codebase, not yours, so expect a high false-positive rate on the first run. Start by running PHPMD in report-only mode, review the findings, and adjust or suppress rules deliberately before making the build fail. Also pin the ruleset and PHPMD versions, because older rulesets can reference rules that modern PHPMD no longer recognises.