composer / package-versions-deprecated

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

Replace muglug/package-versions-56? #16

Closed gmazzap closed 4 years ago

gmazzap commented 4 years ago

I'm having an issue with a project that has to support PHP 7.0+ and uses Psalm.

Psalm <= 3.2.12 uses muglug/package-versions-56 that requires composer-plugin-api: ^1.

Do you think it makes sense to also replace that package here?

Seldaek commented 4 years ago

Could make sense yes, you did see that the latest psalm versions require this fork directly though?

gmazzap commented 4 years ago

Could make sense yes, you did see that the latest psalm versions require this fork directly though?

Yes @Seldaek the problem occurs on PHP 7.0. Latest Psalm version that supports PHP 7.0 is 3.2.2 which depends on that package I mentioned.

That means that on PHP 7.0 there's no way to use Composer 2 in projects requiring Psalm.

Seldaek commented 4 years ago

Yeah the problem is they require muglug's fork in 1.2.4 exactly.. and that has a different namespace as per https://github.com/vimeo/psalm/blob/3.2.12/src/psalm_plugin.php#L9 so this isn't gonna work :/

IMO what you could do as a hack is add provide: {muglug/package-versions-56: 1.2.4} to your composer.json (granted it's not a public package), so composer 2 should resolve.. And then you declare a dummy class returning a fixed version to make https://github.com/vimeo/psalm/blob/3.2.12/src/psalm_plugin.php#L16 run. That should let you upgrade to composer 2.

gmazzap commented 4 years ago

It's a public package. I'm looking the options of dropping 7.0 support.

Feel free to close this and thanks for looking into it.

Seldaek commented 4 years ago

Yeah I don't see another option here sorry.