Make WordPress Core

Changeset 59108


Ignore:
Timestamp:
09/27/2024 07:51:31 PM (9 months ago)
Author:
hellofromTonya
Message:

Code Modernization: Fix trigger_error() with E_USER_ERROR deprecation in WP_Test_Stream::open().

PHP 8.4 deprecates the use of trigger_errror() with E_USER_ERROR as the error level, as there are a number of gotchas to this way of creating a Fatal Error (finally blocks not executing, destructors not executing).
The recommended replacements are either to use exceptions or to do a hard exit.

As this is a test-only class, do not have to take BC-breaks into account.

Also, as this is a test helper, throwing a exception is the most appropriate solution.

Reference:

Follow-up to [49230].

Props jrf.
See #62061.

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.