Passing E_USER_ERROR to trigger_error() is deprecated since 8.4

Created on 11 August 2025, 9 days ago

Problem/Motivation

There is still a PHP 8.4 deprecation:

FILE: ...modules/contrib/search_api/tests/modules/search_api_test/src/MethodOverrides.php
--------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------
 39 | WARNING | Passing E_USER_ERROR to trigger_error() is deprecated since 8.4.
    |         | Throw an exception or call exit with a string message instead.
    |         | (PHPCompatibility.ParameterValues.RemovedTriggerErrorLevel.Deprecated)
 59 | WARNING | Passing E_USER_ERROR to trigger_error() is deprecated since 8.4.
    |         | Throw an exception or call exit with a string message instead.
    |         | (PHPCompatibility.ParameterValues.RemovedTriggerErrorLevel.Deprecated)
--------------------------------------------------------------------------------------

Steps to reproduce

composer require --dev --with-all-dependencies \
    phpcompatibility/php-compatibility:10.x@dev \
    dealerdirect/phpcodesniffer-composer-installer:^1.1
php bin/phpcs -p -s \
  --standard=PHPCompatibility \
  --runtime-set testVersion 8.4 \
  --extensions="inc,install,module,php,profile,theme" \
  docroot/modules/contrib/search_api

Proposed resolution

Throw an exception instead of using trigger_error.

📌 Task
Status

Active

Version

1.0

Component

Tests

Created by

🇩🇪Germany hosterholz

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024