pb30/phpstan-composer-analysis
A PHPStan extension that analyzes your Composer dependencies alongside your code, flagging unused required packages and missing package requirements. Keep composer.json in sync with real usage while running your existing static analysis.
shipmonk/composer-dependency-analyser directly, or composer-unused / composer-require-checker) or to fold it into the PHPStan run the team already has. This package exists specifically to make the second option cheap.require but only used in dev, or vice versa), and undeclared transitive dependencies as PHPStan errors. That directly supports decisions like "can we drop this package," "is this a real dependency or an accident of the autoloader," and "will this composer update break a deploy because we relied on something we never declared."require vs require-dev before extraction.Consider it when:
Look elsewhere when:
shipmonk/composer-dependency-analyser directly; the wrapper adds nothing.composer-require-checker in a Composer script, or a Composer plugin).For executives: This adds a check that the dependencies we declare in Composer match the ones our code actually uses, and it runs inside the code-quality tool we already have in CI. Cost is roughly half a day of setup and a near-zero ongoing pipeline cost; the payoff is eliminating a recurring class of production breakage where a routine composer update removes something we were silently relying on.
For engineering: It is a thin PHPStan extension around shipmonk/composer-dependency-analyser. You register it once in phpstan.neon; unused, shadow, and misplaced dependencies then appear as ordinary PHPStan errors, suppressible through the baseline we already maintain and visible in editors and PR annotations. No new CI job, no new output format, no new suppression file. The trade-off is a small third-party dependency with a single maintainer — if that is unacceptable, the fallback is invoking the analyser's binary as its own CI step, which costs one more job and a second ignore-list. Success looks like: dependency issues caught in the first month, no measurable CI time regression, and zero new pipeline configuration to maintain.
How can I help you explore Laravel packages today?