postmark-php
postmark-php copied to clipboard
Update CaseInsensitiveArray.php
Many errors in PHP 8.0.13+ and 8.1 like this:
Error(8192)("Return type of Postmark\Models\CaseInsensitiveArray::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice") in vendor/wildbit/postmark-php/src/Postmark/Models/CaseInsensitiveArray.php:39
This PR is not the correct fix: the package supports PHP >= 7.0, see https://github.com/wildbit/postmark-php/blob/823ca5bdb6355e266986434fab9139406b6e6c13/composer.json#L10
This is a breaking change making the code PHP8+ only.
A better fix would be to follow the alternative suggestion:
or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Since PHP support for version 7.3 now has been dropped (https://www.php.net/supported-versions.php) suppressing the notice is not the better fix. Dropping PHP 7.x support and actually fixing the code seems the only right thing to do. Maybe do a major release for that to prevent PHP 7 users from auto updating.
7.4 is still security supported until Nov 2022