mirror of
git://develop.git.wordpress.org/
synced 2025-04-07 13:43:25 +02:00
Code Modernization: Fix trigger_error() with E_USER_ERROR deprecation in Text_Diff_Op::reverse().
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`. This is an unmaintained external dependency; thus, the fix is made in the WP specific copy of the dependency. As `trigger_error()` call looks to be a remnant of the PHP 4 era before a class could be declared as `abstract`, fixed by making both the method as well as the class `abstract` and removing the call to `trigger_error()`. Ref: * https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error * https://www.php.net/manual/en/migration80.incompatible.php Follow-up to [7747]. Props jrf. See #62061. git-svn-id: https://develop.svn.wordpress.org/trunk@59106 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9a9ca41ddd
commit
d9fe74bbf8
@ -350,15 +350,12 @@ class Text_MappedDiff extends Text_Diff {
|
||||
*
|
||||
* @access private
|
||||
*/
|
||||
class Text_Diff_Op {
|
||||
abstract class Text_Diff_Op {
|
||||
|
||||
var $orig;
|
||||
var $final;
|
||||
|
||||
function &reverse()
|
||||
{
|
||||
trigger_error('Abstract method', E_USER_ERROR);
|
||||
}
|
||||
abstract function &reverse();
|
||||
|
||||
function norig()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user