Problem/Motivation
When a class uses ComputedItemListTrait
, a PHP 8.1 deprecation is trigger on offsetExists
because return is not typed as bool
.
Steps to reproduce
For example the profile module uses this trait in the class Drupal\profile\Plugin\Field\ProfileEntityFieldItemList
. Displaying the login pane in a commerce checkout displays this error.
Proposed resolution
As for the others deprecated functions of this trait we could simply add #[\ReturnTypeWillChange]
to suppress the deprecation.