Ocramius / PackageVersions

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

Replace rule is too wide #165

Closed Jean85 closed 3 years ago

Jean85 commented 3 years ago

This was originally reported as https://github.com/Jean85/pretty-package-versions/issues/29

The issue is in this snippet:

https://github.com/Ocramius/PackageVersions/blob/2.4.x/composer.json#L25

The current replace rule is a bit overreaching, since it also replaces the 1.x version of that package. I'm reporting this for documentation, since I fear that, as of now, with already tagged and released versions, Composer will always reach this version and create this issue. Or is there any other solution?

On my end, I'll try to find time to release a new version that leverage the Composer 2 API directly as a workaround.

Ocramius commented 3 years ago

Yes, that's intentional: I pretty much stopped caring, because of overly-aggressive third parties that I have no interest in aiding.

In practice, the API of this package is defined by this package, not by the deprecated substitute.

Ocramius commented 3 years ago

Let me rephrase: I did this intentionally.

The correct approach is to require ocramius/package-versions, then add composer/pqckage-versions-deprecated if there is a need to run composer v2 on ancient php versions (bad idea, IMO)