Open martinvigholm opened 1 year ago
Just wanted to chime in here as well. :) Would be great to get this fixed. Since this library/plugin supports PHP7 (according to composer.json
) adding mixed
as a return type to Data::offsetGet
won't work since it was introduced in PHP8: https://www.php.net/manual/en/language.types.mixed.php but adding the #[\ReturnTypeWillChange]
attribute will at least suppress the warning for now. The same should be done for offsetSet
and offsetUnset
since they should use the void
return type which wasn't introduced until PHP7.1 https://www.php.net/manual/en/migration71.new-features.php.
offsetExists
can have a return type of bool
set since that was introduced in PHP7: https://www.php.net/manual/en/migration70.new-features.php
Happy to make a PR if you'd like!
Any news regarding this issue? Would love to see this fixed.
Error when updating to PHP 8.1:
PHP Fatal error: During inheritance of ArrayAccess: Uncaught ErrorException: Return type of SwedbankPay\Core\Data::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/swedbank-pay/swedbank-pay-woocommerce-core/src/SwedbankPay/Core/Data.php:132
Should be fixed with correct return value from the methods?