swagger-php icon indicating copy to clipboard operation
swagger-php copied to clipboard

[v6] Bump PHP deps to 8.1 (or 8.2?)

Open DerManoMann opened this issue 1 year ago • 5 comments

Just a place holder and reminder.

Affected user (going to PHP 8.1): v5 -> v6 : 1.7% v4 -> v6 : 5.8%

Affected user (going to PHP 8.2): v5 -> v6 : 6.8% v4 -> v6 : 18.6%


  • Bump deps to PHP 8.1
  • Refactor Util class into one/more non-static classes
    • FinderFactory ::finder()
    • Encoder refEncode(), refDecode()
    • Merge shorten() into a new/simpler logger?
  • #1678
  • #1162
  • ~~remove Generator::getDefaultConfig()~~
  • remove other deprecated elements
  • deprecate Generator::scan method

DerManoMann avatar Nov 10 '24 03:11 DerManoMann

I think this can safely be done in v5 since 8.0 and lower is already deprecated

fulldecent avatar Nov 14 '24 18:11 fulldecent

It is, but we are taking things slowly. PHP 7.4 -> PHP 8.0 is still used by ~8% of users of v4.

I would think v6 with min PHP 8.1 will be coming around the middle of 2025.

DerManoMann avatar Jan 07 '25 04:01 DerManoMann

Having second thoughts about perhaps going to PHP 8.2 directly after all. The latest stats show a lot less impact and seeing that PHP 8.5 will be out soon it feels reasonable.

The types refactor will still land on [v5], so I would think that is going to be the only big change in the near future....

Thoughts?

DerManoMann avatar Oct 10 '25 02:10 DerManoMann

Having second thoughts about perhaps going to PHP 8.2 directly after all. The latest stats show a lot less impact and seeing that PHP 8.5 will be out soon it feels reasonable.

Maybe you can consider if are you planning on using specific features released in PHP 8.2? That could maybe help make a decision on which version you want.

Back when I was working on version 5 of https://github.com/nelmio/NelmioApiDocBundle I decided to go for 8.1 as my minimum because of the new features that I wanted to use:

  • nested attributes (to allow getting rid of https://github.com/doctrine/annotations)
  • enums

PHP 8.2 didn't really bring me any features or direct bug fixes that I would want/need to use, so in my opinion it would have brought more harm than good (by making it easier for users to upgrade).

❤️

DjordyKoert avatar Oct 23 '25 09:10 DjordyKoert

Thanks for the feedback - nice to know that I am not (always) just talking to myself here :)

I guess dabbling with type-info makes you itch to be able to require it rather than recommend ;)

I think I'll follow you reasoning and stick with 8.1 for now. There isn't anything that would life much easier in 8.2. I guess 8.2+ would be also the time for other bigger changes - dropping annotation support for good, for example. However, that is a lot more than I am willing to consider ATM.

DerManoMann avatar Oct 29 '25 02:10 DerManoMann

I guess dabbling with type-info makes you itch to be able to require it rather than recommend ;)

That could be a valid reason aswell for php 8.2 haha. I also wanted to make it a hard dependency for the Nelmio bundle, but I also just now ran into the issue that it won't work with PHP 8.1 https://github.com/nelmio/NelmioApiDocBundle/pull/2610 ☹️

DjordyKoert avatar Nov 14 '25 12:11 DjordyKoert

Update: After some research and thinking, I will probably drop support for 8.1 in favor of actively supporting symfony/type-info

https://github.com/nelmio/NelmioApiDocBundle/pull/2611

DjordyKoert avatar Nov 14 '25 13:11 DjordyKoert

Good point. For v5 users there is not a lot of impact and for lower versions there is no difference anyway. It would be nice to go to 8.2, in particular since I do not have the resources to maintain many different versions... Kinda sold on this now :)

DerManoMann avatar Nov 23 '25 02:11 DerManoMann

Cut a 5.x branch and did a lot more cleanup on the v6 branch. Going to merge soon, so master will be 6.x soon :) Hope there will be people testing. Wonder if it is worth creating some RC releases first...

DerManoMann avatar Nov 24 '25 03:11 DerManoMann