Add fixes to be compatible with PHP 8.1
Massive thanks to @andrewbess for this improvement to the v2 release.
- The composer dependencies have been updated to be compatible with PHP 8.1
- Added fixes for extension have been compatible with PHP 8.1
- build: normalise dependency versions