Deprecated function: Return type of Drupal\cached_computed_field\ExpiredItemCollection::count()

Created on 7 February 2024, 11 months ago
Updated 10 July 2024, 6 months ago

Problem/Motivation

Drupal 10.2.2

After cron running the following warning was raised:
Deprecated function: Return type of Drupal\cached_computed_field\ExpiredItemCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 8 of /var/www/upgrade/aced8/site/modules/contrib/cached_computed_field/src/ExpiredItemCollection.php)

Steps to reproduce

1. Install and enable the module.
2. Configurate the batch settings.
2. Run cron.

Proposed resolution

Update the count method in the ExpiredItemCollection class to make it compatible with Countable::count(): int.

πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine v.dovhaliuk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024