Note: QuickForm2 would meanwhile also be available via composer, so we could switch using that instead. Unfortunately QuickForm2 is compatible with PHP 5.4+, which makes it impossible to have it compatible with PHP 8.1
as well. I first created an approach using composer and forked the QuickForm2 repos to adjust the fixes (see https://github.com/matomo-org/matomo/compare/quickform_composer), but guess they might not be merged upstream because of the PHP requirement maybe. So guess simply adjusting the code here would be the simplest solution for now.
Yes kind of. The other solution would be to add a
#[\ReturnTypeWillChange] attribute to those methods.
But I check each page were I needed to apply a fix with PHP 8.1 and PHP 7.2, to ensure it doesn't regress for older versions