composer / package-versions-deprecated

:package: Composer addon to efficiently get installed packages' version numbers
MIT License
1.51k stars 9 forks source link

Narrow range in "replace" section of composer.json #3

Closed nicolas-grekas closed 4 years ago

nicolas-grekas commented 4 years ago

This "replace" range makes the package conflict with dependent that conflict with e.g. "ocramius/package-versions": "<1.3"

See https://github.com/getsentry/sentry-symfony/pull/347 for a real-world application of this issue.

This could also be considered as a bug in Composer itself since the range has a non-empty intersection with the complement of the conflicting rule. But I don't know how difficult it would be to make Composer consider this refinement.

Seldaek commented 4 years ago

IMO the replace needs to stay as it to make sure that if some of your lib requires ocramius/package-versions 1.2.* for example it can be overridden by requiring this fork.

On the other hand, I guess releasing a new version with a narrower replace will allow composer to find either version 1.8.0 or 1.8.1 as a satisfactory solution, so it's probably fine.