Page MenuHomePhorge

PHP 8.2: fix deprecated use of "parent" in callables
ClosedPublic

Authored by valerio.bozzolan on Mar 26 2023, 15:42.
Tags
None
Referenced Files
F3305072: D25099.1743109844.diff
Wed, Mar 26, 21:10
F3299402: D25099.1743020510.diff
Tue, Mar 25, 20:21
F3250267: D25099.1742298539.diff
Mon, Mar 17, 11:48
F3236434: D25099.1742171373.diff
Sun, Mar 16, 00:29
F3224868: D25099.1742089447.diff
Sat, Mar 15, 01:44
F3222021: D25099.1741899339.diff
Wed, Mar 12, 20:55
F3220473: D25099.1741810193.diff
Tue, Mar 11, 20:09
F3220472: D25099.1741810189.diff
Tue, Mar 11, 20:09
Tokens
"Like" token, awarded by valerio.bozzolan.

Details

Summary

Closes T15200

Test Plan

Test 1:

I was able to run arc unit --everything without the error thrown from T15200

Test 2:

I also tried this and it still works:

php -a
require 'src/applications/metamta/exception/PhabricatorMetaMTAReceivedMailProcessingException.php';
$asd = new PhabricatorMetaMTAReceivedMailProcessingException("1", "TEST MESSAGE");
var_dump($asd->getMessage());

You get:

string(12) "TEST MESSAGE"

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/applications/metamta/exception/PhabricatorMetaMTAReceivedMailProcessingException.php
17

The above line means that if you do this somewhere:

new PhabricatorMetaMTAReceivedMailProcessingException( 'asd', 'lol' );

The above lines do this:

parent::__construct( 'asd', 'lol' );

That for my case is:

Exception::__construct( 'asd', 'lol' );

Note that get_parent_class($this) returns the word Exception.

src/applications/metamta/exception/PhabricatorMetaMTAReceivedMailProcessingException.php
18

In short using the string 'parent' is deprecated.

It was replaced with get_parent_class($this) that at runtime gives the parent, and it's the exact replacement.

This revision is now accepted and ready to land.Mar 29 2023, 18:18