Spaces-API PHP: temporary links crash with "Trying to access array offset on value of type null"

Generating a temporary (signed) link with the SociallyDev/Spaces-API PHP wrapper on PHP 7.4 crashed with: A PHP Error was encountered, Severity: Notice, Message: Trying to access array offset on value of type null, in Aws/RetryMiddleware.php line 75, triggered through S3Client.php when the temporary-link function ran. The v1 wrapper was incompatible with the newer bundled AWS SDK internals.

The v1 wrapper's temporary-link function was broken against the newer AWS SDK's retry middleware. The maintainer rewrote the package as v2 with a new API for signed URLs: Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3")->signedURL("my-file.txt", "15 minutes") returns a URL valid for 15 minutes. Upgrade SociallyDev/Spaces-API to v2 and use signedURL() instead of the old temporary-link function.

Source: https://github.com/SociallyDev/Spaces-API/issues/46

Source: https://github.com/SociallyDev/Spaces-API/issues/46