Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
VincentLanglet opened this issue Nov 27, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@VincentLanglet
Copy link
Contributor

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 ?

@janedbal
Copy link
Member

Yeah, extensions are a bit more tricky due to that optional dependency in libraries (example). Adjusting reported issues for suggested extensions might improve the DX there for sure. I'll consider it.

@janedbal janedbal added the enhancement New feature or request label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants