-
Notifications
You must be signed in to change notification settings - Fork 15
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
Deprecate InstalledVersions::getRawData #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads up, it's nice to tackle this head on.
I'm sorry but this PR is not feasible in this form. getAllRawData
is present only since the commit you listed, and hence it would break under any Composer between 2.0.0 and 2.0.13.
The only way around this that I see is to check for method existence.
@Jean85 Thanks, that makes sense! Let me know if it needs any additional changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks fine, thanks!
I was going to propose an optimization, but I just only noticed that you're dealing with N possible entries with this change, so no optimization is doable...
I would like to cover this with tests but I don't think it will be doable :( Damn
I've approved the CI, it's complaining because it doesn't recognize the method... I don't understand why, probably composer in CI is older than the requested patch? Maybe we can downgrade Composer in the |
I've added some additional steps to the tests. Not sure if this will fix them. Can you approve the GitHub Action? |
@BramRoets I reworked the CI flow, since it had complications from when 8.0 wasn't stable. I also found a way to solve the Composer version constraint using I'll also check the PHPStan issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PHPStan doesn't budge, I don't know why it doesn't recognize the presence of that method, neither the existence check.
Please put that in the baseline to fix the CI, and add a changelog entry for this PR, then it's good to merge.
Hi Jean, I'm not sure. Do you need any input from my side? |
Hi, |
I had to manually merge this since I couldn't push this from local, don't know why. Thanks anyway @BramRoets! This has been released as 2.0.4: https://github.com/Jean85/pretty-package-versions/releases/tag/2.0.4 |
Thanks a lot for quick turnaround 🙇🏻♂️ What are the chances that this will be backported to 1.6.x branch? |
@filakhtov this issue does not affect 1.6 because I do not use the Composer API directly there, but I use |
Composer released an update that deprecates the
getRawData()
method.This PR uses the new recommended
getAllRawData()
method.This package is used by https://github.com/getsentry/sentry-php. After a recent deployment, Sentry stopped working because of the change made by composer. I hope to get this PR merged and then update the requirement in Sentry.
Related commit in Composer: https://github.com/composer/composer/pull/9816/files