Deprecated: Implicitly marking nullable parameter as nullable in PHP 8.4

Created on 16 July 2025, 4 days ago

Problem/Motivation

With PHP 8.4, the following deprecation warning is thrown:

Deprecated: Drupal\search_api_algolia\Plugin\search_api\backend\SearchApiAlgoliaBackend::deleteAllIndexItems(): Implicitly marking parameter $index as nullable is deprecated, the explicit nullable type must be used instead in /modules/contrib/search_api_algolia/src/Plugin/search_api/backend/SearchApiAlgoliaBackend.php on line 436

This is due to the method signature of deleteAllIndexItems() where the $index parameter is implicitly nullable, but not explicitly marked with the ? type hint.

Proposed resolution

Update the method signature to explicitly mark the parameter as nullable:

public function deleteAllIndexItems(?IndexInterface $index = NULL)

πŸ“Œ Task
Status

Needs work

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine Anna D

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

Comments & Activities

Production build 0.71.5 2024