Pros:
Cons:
composer.json).app/Console/Kernel.php events) without custom glue code.laravel-pint, pestphp/pest, or nunomaduro/collision.Why PHPMD over alternatives?
UnusedPrivateMethod, TooManyParameters) not covered by PHPStan/Psalm?Robo Dependency Acceptance
Laravel Integration Gaps
Maintenance Plan
phpmd/phpmd + custom script) with lower risk?nunomaduro/collision).phpstan/extension-installer).composer.json as a dev dependency:
composer require --dev sweetchuck/robo-phpmd
robo.php (if not using Laravel’s Artisan).// app/Console/Commands/PhpMdCommand.php
use Sweetchuck\Robo\PhpMessDetector\PhpmdTaskLoader;
use Robo\Tasks;
class PhpMdCommand extends Command {
use PhpmdTaskLoader;
public function handle() {
$this->taskPhpmdLintFiles()
->setPaths([app_path('..')])
->run();
}
}
.github/workflows/linting.yml:
- name: PHPMD
run: vendor/bin/robo phpmd
robo/robo compatibility (may need pinning).phpmd/phpmd + custom script).robo.phar management).composer require --dev phpmd/phpmd
./vendor/bin/phpmd src/ text ./ruleset.xml
--parallel), but the Robo wrapper may not expose this.--exclude paths carefully configured).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| PHPMD rule misconfiguration | False positives/negatives | Start with --report-format=xml for debugging. |
| Robo task execution failure | CI build breaks | Fall back to direct PHPMD CLI. |
| PHP version incompatibility | Silent failures or crashes | Test on PHP 8.x early; fork if needed. |
| Abandoned package | Security/bug vulnerabilities | Replace with phpmd/phpmd after pilot. |
| RuleSet XML errors | Build failures | Validate XML with xmllint. |
robo.php setup in CONTRIBUTING.md.--dry-run flag for testing).How can I help you explore Laravel packages today?