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
F2931453: D25099.1737709031.diff
Thu, Jan 23, 08:57
F2925100: D25099.1737590821.diff
Wed, Jan 22, 00:07
F2913810: D25099.1737431050.diff
Mon, Jan 20, 03:44
F2905506: D25099.1737346262.diff
Sun, Jan 19, 04:11
F2905505: D25099.1737346261.diff
Sun, Jan 19, 04:11
F2905401: D25099.1737345145.diff
Sun, Jan 19, 03:52
F2905329: D25099.1737342532.diff
Sun, Jan 19, 03:08
F2890120: D25099.1737205535.diff
Fri, Jan 17, 13:05
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