sabre-io / event

:bell: The sabre/event library provides utilities for lightweight event-based programming
http://sabre.io/event/
BSD 3-Clause "New" or "Revised" License
350 stars 21 forks source link

PHP 8.4 compliance #123

Open cedric-anne opened 1 month ago

cedric-anne commented 1 month ago

We are currently using the sabre/dav in an open source project and we want to make it fully compliant with PHP 8.4, and we cannot upgrade to sabre/event:^6.0 because sabre/dav is not compatible with it.

If we provide a patch for it, would you accept to integrate it in a new 5.1.5 version ?

There is at least the following deprecation to fix:

Deprecated: Sabre\Event\Loop\instance(): Implicitly marking parameter $newLoop as nullable is deprecated, the explicit nullable type must be used instead in /var/www/glpi/vendor/sabre/event/lib/Loop/functions.php on line 133
staabm commented 1 month ago

I think these deprecations should be fixed with cs fixer over the whole codebase (maybe also other sabre/* repos). since fixing this error is backwards compatible we could do it in the older versions :+1:

phil-davis commented 1 month ago

PR #124 - I tried running the analysis tools in master with PHP 8.4. There are lots of vendor dependencies that need these deprecations adjusted.

I will also try in the major version 5 branch - that at least might show me the adjustment needed to the Event code (and lots of other vendor dependency issues!)

cedric-anne commented 1 month ago

maybe also other sabre/* repos

I confirm that it affects multiple sabre/* components we use.

phil-davis commented 1 month ago

I will link all the various related PRs to this issue, and keep the issue open until all PHP 8.4 compliance has been done.

phil-davis commented 1 month ago

These repos have been updated:

staabm commented 1 month ago

Just want to say thank you ❤️ for working thru all the repo @phil-davis

phil-davis commented 1 week ago

Also to-do is to forward-port code changes from the old major-version branches in each repo to the later (current...) branches and release PHP 8.4 compatible code in those branches.

phil-davis commented 22 hours ago

I have got all the various major release branches of the "small" repos up-to-date with all the tools (cs-fixer, phpstan) and with CI running PHP 8.4, and releases done. So event, http, xml and uri are done.

Now that they all pass cleanly, I will move on to getting the CI sorted out for vobject, and make releases for each major branch of that. And then do the same for "dav" (which is at the top of the dependency tree).