Commit fd0694e
Support PHPMD 3 in the mess detector runner
PHPMD 3 changed how the command is called: it is now a Symfony console
command taking an InputInterface, instead of the old array based
CommandLineOptions. The runner still used the old call, so the job crashed
with a TypeError before analysing anything.
The images do not all carry the same PHPMD, so the runner now checks what is
installed and calls it accordingly:
- PHP 8.1 image builds Magento 2.4.7, which pins phpmd/phpmd ^2.12 -> PHPMD 2
- PHP 8.2-8.4 images build Magento 2.4.8-p5 -> PHPMD 3
- PHP 8.5 image builds Magento 2.4.9 -> PHPMD 3
Two related breakages are fixed at the same time:
- PHPMD 2.15 made Command::__construct() require a \PHPMD\Console\Output.
The runner passed no argument, so the PHP 8.1 image already failed with an
ArgumentCountError, independently of PHPMD 3. The command is now built
based on what the installed version expects.
- PHPMD 3 renamed Command::EXIT_SUCCESS to Command::SUCCESS, which would
have broken the assertion right after the first fix.
Verified against the real images, on a clean module and on a file with four
deliberate violations, to confirm the job both passes and still reports
findings in the github annotation format:
image Magento PHPMD clean 4 planted violations
8.1 2.4.7-p10 2.15.0 passes all 4 reported
8.4 2.4.8-p5 3.0.0 passes all 4 reported
8.5 2.4.9 3.0.0 passes all 4 reported
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 6e27587 commit fd0694e
2 files changed
Lines changed: 48 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
59 | 80 | | |
60 | 81 | | |
61 | 82 | | |
| |||
71 | 92 | | |
72 | 93 | | |
73 | 94 | | |
74 | | - | |
75 | | - | |
76 | 95 | | |
77 | 96 | | |
78 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
79 | 114 | | |
80 | 115 | | |
81 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
74 | 84 | | |
75 | 85 | | |
0 commit comments