Skip to content

Suggested ext-* are reported as unused (or only used in dev) #206

@VincentLanglet

Description

@VincentLanglet

Let's say I use this lib
https://github.com/Intervention/image/blob/develop/composer.json#L34

The lib suggests to use ext-exif but does not hard-require it.

When adding ext-exif to my composer.json, it's reported as unused by the composer-dependency-analyser (awesome tool btw),
but having or not this extension gives a different behavior when using such library.
There is also a lot of others dependencies which have "required" extensions, in suggest.

Message like

  • Found 1 prod dependency used only in dev paths!
  • Found 1 unused dependencies!

for ext which are suggested might lead to removing the library with bad impact in production.

I assume the same might exists for lib suggested (?), because a dependency could have the implementation

if (class_exists(SuggestedDependency::class)) {
     // do this
} else {
    // do that, which is not as good
}

So maybe a different behavior should exist for suggested libraries/ext ? or an option to not report unused lib/ext if they are suggested ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions