Closed wardtd closed 2 years ago
I am also running into this with running my project on PHP 8.1, although to clarify: this is only a deprecation notice, not a run-time failure, so it is easy to ignore for now, but a fix would be appreciated.
We need to add #[ReturnTypeWillChange]
to those methods to suppress the errors.
This should be resolved as of 1.7.0
. Let us know if you have any questions!
Please fill out the sections below to help us address your issue.
Version of AWS SDK for PHP?
N/A
Version of Amazon SNS Message Validator for PHP?
1.6.0
Version of PHP (
php -v
)?8.1rc1
What issue did you see?
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Aws\Sns\Message::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/runner/work/laravel-aws-sns/laravel-aws-sns/vendor/aws/aws-php-sns-message-validator/src/Message.php:100
Steps to reproduce
This is a run-time failure due to a signature validation error any time the method is invoked.
Additional context
We identified this issue when attempting to validate a package using the message validator against PHP 8.1rc1. We will be submitting a pull request in the future to resolve this issue.