From d4b071bd1e700816fec1167ca973e012eda87864 Mon Sep 17 00:00:00 2001 From: Sam B <130986804+sam-bee@users.noreply.github.com> Date: Tue, 21 May 2024 21:45:37 +0100 Subject: [PATCH] To enable to the TransportException code to be accessed in PHP < 8.1, make reflection property accessible (#11974) --- src/Composer/Console/Application.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index f1d5d9ffb..2f3e2c4b1 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -446,6 +446,7 @@ class Application extends BaseApplication // as http error codes are all beyond the 255 range of permitted exit codes if ($e instanceof TransportException) { $reflProp = new \ReflectionProperty($e, 'code'); + $reflProp->setAccessible(true); $reflProp->setValue($e, Installer::ERROR_TRANSPORT_EXCEPTION); }