Problem/Motivation
We use a composer scaffolding that places the phpcs/phpcbf binaries in the /bin dir and the audit module does not detect them.
Proposed resolution
Allow to configure a path to the binaries and use the common paths as fallback.
Issue fork audit-3585432
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
harlor commentedComment #5
trebormcHi @harlor,
Thanks for the report and for opening MR !1.
Just landed a fix on `1.x` that builds on top of your MR. Two changes worth flagging vs. your patch:
First, the two config keys (`phpcs_binary_path` and `phpcbf_binary_path`) are kept exactly as you proposed, settable independently, full absolute path to each binary. That's the right level of flexibility for cases where the two tools live in different directories or are exposed as wrapper scripts with non-standard names. Reusing your naming and your schema shape so the migration is a no-op.
Second, the resolution order now also auto-detects Composer's `config.bin-dir` from the project's `composer.json` before falling back to hardcoded paths. That's the bit that makes your specific case (composer scaffolding that puts binaries in `bin/`) work with zero configuration, the analyzer reads `config.bin-dir`, finds the binaries there and runs. The explicit per-binary overrides still win over auto-detection, so the form fields keep their usefulness for the edge cases.
Final resolution order:
1. `phpcs_binary_path` / `phpcbf_binary_path` config override (independent per binary).
2. Composer's `config.bin-dir` read from the project's `composer.json`.
3. The previous hardcoded `vendor/bin/` locations, plus new fallbacks under `bin/`.
Added unit tests covering the independent override paths, the renamed-binary case, and the fall-through when the override is invalid. Ships in the next release.
Marking as fixed. Please reopen if anything in your setup still slips past after upgrading.
Thanks again!
Comment #7
trebormc