-
-
Notifications
You must be signed in to change notification settings - Fork 150
Improve PHP 8.5+ support by avoiding deprecated switch case syntax #264
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
Conversation
This must have been a typo, since it's the only instance where the non-standard syntax is used.
Hey, thanks @theodorejb for taking the time to file this PR. There are two things that bother me with this:
|
@WyriHaximus I ran a script across the top Composer packages to find any that were using the alternate switch case syntax, since I'm considering writing an RFC to deprecate it. In the top 1000 packages, this was one of only two where I found it used. All usages appeared to be typos (randomly mixed in with case statements using the standard syntax). PHP-CS-Fixer will automatically find/fix these issues when using the |
@theodorejb Ahh cool thanks, and tbh been doing PHP for 20+ years and only learned today this is valid syntax 🤦 . And honestly that RFC makes sense. |
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.
@theodorejb TIL! Thanks for looking into this and best of luck with that RFC 👍
(I've marked this as maintenance to emphasize this shouldn't otherwise affect how this code functions.)
Could this fix please be released with due haste ? The PHP 8.5 deprecation has been merged into PHP core and the nightly build for This effectively means that the deprecation notice for the code in the 3.2.0 version is currently causing |
Yeah. Release would be great due to the "global" composer usage. We added PHP 8.5 to our CI matrix just yesterday, and decided to greenify our pipeline with a composer-patch: TYPO3/Fluid#1189 (just mentioning in case you need something, too). |
Just in case anyone desperately needs it - for most CIs, another work-around is to first A new release would be nicer, but ☝🏻 can unblock people if needs be, without needing to patch the package. |
@WyriHaximus @clue Just a heads-up: the PHP 8.5 Linux nightly image used by |
This builds on top of reactphp#264 porting that change to v2.
We know <3, but a few things.
Unless I misunderstood how composer builds its bins. It takes the lowest targeted version in range. Which is v2 of this package: https://github.com/composer/composer/blob/main/composer.json#L40 and that version still contains this issue: Line 369 in 1a84609
We should. |
@WyriHaximus Thanks for setting that up! I've just read through the build scripts from Composer and from what I can see, the PHAR file should be using How I got to that tentative conclusion:
This looks to be confirmed when checking the build-script from the last release: https://github.com/composer/composer/actions/runs/16201695550/job/45742084992#step:4:67 The LTS Composer 2.2 branch looks to be on All in all, my supposition is that the This looks to be confirmed by the relevant commit and issue composer/composer#12188 which added the Hope this helps! |
Is there any expected date for patch release like 3.2.1? |
@andypost You can use the work-around described here to continue testing against PHP 8.5 without this patch. |
Just in case anyone needs some example code for the work-around I mentioned before, I'm applying it as a temporary measure to the PHPCS test workflow (as releasing a new major with red crosses on every workflow run makes me uncomfortable 😉) Once a new version of Composer has been released, I'll revert it. |
For reference, the relevant RFC: https://wiki.php.net/rfc/deprecations_php_8_5#languagesyntax_deprecations |
@jrfnl Thanks for the friendly reminder. Discussed this PR earlier today in the team and will prioritize releasing this once the other maintenance PRs on this milestone are merged. Seeing this currently blocks Composer, definitely expect a release this week, hopefully in the next couple of days. If you're impatient, you can always support the project and may help speed things up by becoming a sponsor ❤️ |
@clue Appreciate the update! |
@clue P.S.: didn't mean to ignore your remark about funding, but I'm not the right audience for that. I'm only a lowly, barely paid open source maintainer myself. So let me join you in the call for funding: |
As I just merged #269 and as @clue noted on that PR, the v2 branch will need more changes to get it to work on PHP 8.4. However, as we haven't received any issues about PHP 8.4 compat, and as @jrfnl pointed out in #264 (comment) we're not considering a new v2 tag to address this, unless PHP 8.(4|5) support comes up in an (high profile) issue. Will review #271 tomorrow morning and if it's good merge and release it. |
Bit later than planned today, but |
Thank you all for getting 3.3.0 released! Now, let's hope Composer updates and releases a new version soon ;-) |
At this moment, nearly every single `composer install` on PHP 8.5 is failing on a deprecation notice coming from the `react/promise` package. To mitigate this, the ReactPHP team has just released a new version and I'd like to suggest for Composer to update to that version and release a new version of Composer itself to unblock early adopters from testing with PHP 8.5. Note: other than fixing the deprecation notice, the `3.3.0` release does not contain any user-facing changes. Ref: * reactphp/promise#264 * https://github.com/reactphp/promise/releases/tag/v3.3.0 * reactphp/promise@v3.2.0...v3.3.0
FYI: I've opened a PR to Composer to update their dependency: composer/composer#12504 |
At this moment, nearly every single `composer install` on PHP 8.5 is failing on a deprecation notice coming from the `react/promise` package. To mitigate this, the ReactPHP team has just released a new version and I'd like to suggest for Composer to update to that version and release a new version of Composer itself to unblock early adopters from testing with PHP 8.5. Note: other than fixing the deprecation notice, the `3.3.0` release does not contain any user-facing changes. Ref: * reactphp/promise#264 * https://github.com/reactphp/promise/releases/tag/v3.3.0 * reactphp/promise@v3.2.0...v3.3.0 Co-authored-by: jrfnl <[email protected]>
This must have been a typo, since it's the only instance where the non-standard syntax is used.