-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Description
When you require a package of the type "metapackage", a scan always gives the error:
Found 1 unused dependency!
(those are listed in composer.json, but no usage was found in scanned paths)
Metapackages don't come with any files and will not appear to be used by code in most cases.
It can be used to include other dependencies or make sure some packages or versions of packages are not installed. I mainly use it to trigger conflicts with packages that have a bug in specific versions.
https://getcomposer.org/doc/04-schema.md#type
Bug
A package with type "metapackage" should not trigger an unused dependency error.
Usage of code that is installed because it is required by a metapackage should obviously still trigger a shadow-dependency error.
Workaround
You can add configuration to not trigger the error like so:
$config->ignoreErrorsOnPackage('vendor/package-name' [ErrorType::UNUSED_DEPENDENCY])
But it doesn't really make sense to always have to do this for a metapackage.