dependencies
Analyzes missing, unused, misplaced, and outdated Composer dependencies.
Description
The dependencies
command (alias: deps
) analyzes missing, unused,
misplaced, and overly outdated Composer dependencies using two tools:
composer-dependency-analyser- detects missing, unused, and misplaced packagesjack breakpoint- fails when too many outdated packages accumulate
These analyzers ship as direct dependencies of fast-forward/dev-tools
, so
consumer repositories do not need extra setup before running the command.
Usage
composer dependencies
composer dependencies [options]
composer deps
vendor/bin/dev-tools dependencies [options]
Options
--max-outdated=<count>(optional)-
Maximum number of outdated packages allowed by
jack breakpoint.Default:
5when you run the command directly.Use
-1to keep the outdated dependency report in the output while ignoring Jack failures in the final command status. --upgrade(optional)-
Applies the Jack upgrade workflow before the analyzers:
vendor/bin/jack raise-to-installedvendor/bin/jack open-versionscomposer update -Wcomposer normalize
Without
--upgrade, the command runs the Jack workflow in preview mode before the analyzers. --dev(optional)- Prioritizes dev dependencies where Jack supports it.
--dump-usage=<package>(optional)- Asks
composer-dependency-analyserto dump usages for the given package or wildcard pattern and enables--show-all-usagesautomatically. --json- Emit a structured machine-readable payload instead of the normal terminal output.
--pretty-json- Emit the same structured payload with indentation for terminal inspection.
Examples
Run dependency analysis:
composer dependencies
Allow up to 10 outdated packages:
composer dependencies --max-outdated=10
Report outdated packages without failing on their count:
composer dependencies --max-outdated=-1
Preview the upgrade workflow:
composer dependencies --dev
Dump all matched usages for one package:
composer dependencies --dump-usage=symfony/console
Apply the upgrade workflow and then analyze dependencies:
composer dependencies --upgrade --dev
Using the alias:
composer deps
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success. No missing, unused, misplaced, or excessive outdated dependencies. |
| 1 | Failure. A dependency analyzer or Jack reported findings or errors. |
Behavior
- Always previews or applies
jack raise-to-installedfirst and thenjack open-versionsbefore running the analyzers. - Runs
composer-dependency-analyserandjack breakpointafter the Jack preview or upgrade phase. composer-dependency-analyseris configured with: ---config composer-dependency-analyser.php(resolved through the package file locator so consumer repositories can override it locally) - the packagedcomposer-dependency-analyser.phpdelegates toFastForward\DevTools\Config\ComposerDependencyAnalyserConfigso consumer repositories can extend the baseline instead of copying it whole ---dump-usages <package>and--show-all-usageswhen--dump-usageis passed to the DevTools commandjack breakpointmaps--max-outdatedto Jack's--limitoption.--max-outdated=-1keepsjack breakpointin the workflow for reporting, but its failure is ignored so only missing or unused dependency findings fail the command.--upgradeapplies Jack'sraise-to-installedandopen-versionscommands beforecomposer update -Wandcomposer normalize.- the packaged
tests.ymlworkflow uses--max-outdated=-1by default so dependency health remains a required CI job while outdated-package counts are reported without failing the workflow on their own. - Returns a non-zero exit code when missing, unused, misplaced, or too many outdated dependencies are found.
- Both tools must be available in
vendor/bin/.