Page MenuHomePhorge

PHP 8.2: Use of "parent" in callables is deprecated
Closed, ResolvedPublic

Description

In PHP 8.2:

$ arc unit --everything
   FAIL  PhabricatorMetaMTAReceivedMailTestCase::testDropSelfMail
EXCEPTION (RuntimeException): Use of "parent" in callables is deprecated
#0 /var/www/phorge/src/applications/metamta/exception/PhabricatorMetaMTAReceivedMailProcessingException.php(17): PhutilErrorHandler::handleError(8192, '...', '...', 17)
#1 /var/www/phorge/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php(368): PhabricatorMetaMTAReceivedMailProcessingException->__construct('...', '...')
#2 /var/www/phorge/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php(151): PhabricatorMetaMTAReceivedMail->dropMailFromPhabricator()
#3 /var/www/phorge/src/applications/metamta/storage/__tests__/PhabricatorMetaMTAReceivedMailTestCase.php(19): PhabricatorMetaMTAReceivedMail->processReceivedMail()
#4 /var/www/arcanist/src/unit/engine/phutil/PhutilTestCase.php(634): PhabricatorMetaMTAReceivedMailTestCase->testDropSelfMail()
#5 /var/www/arcanist/src/unit/engine/PhutilUnitTestEngine.php(69): PhutilTestCase->run()
#6 /var/www/arcanist/src/unit/engine/ArcanistConfigurationDrivenUnitTestEngine.php(148): PhutilUnitTestEngine->run()
#7 /var/www/arcanist/src/workflow/ArcanistUnitWorkflow.php(170): ArcanistConfigurationDrivenUnitTestEngine->run()
#8 /var/www/arcanist/scripts/arcanist.php(427): ArcanistUnitWorkflow->run()
#9 {main}

Deprecation:

https://wiki.php.net/rfc/deprecate_partially_supported_callables

Implementation:

https://github.com/php/php-src/pull/7446

How related people fix this:

Example diff:

-return call_user_func('parent'                . '::__isset', $name);
+return call_user_func(get_parent_class($this) . '::__isset', $name);

Event Timeline

valerio.bozzolan created this task.
valerio.bozzolan created this object in space S1 Public.