From 6a6975f7d267e8b0081b0c884ab7e2222edde2e0 Mon Sep 17 00:00:00 2001 From: Christian Heel <66922325+heelc29@users.noreply.github.com> Date: Sun, 28 Sep 2025 18:00:45 +0200 Subject: [PATCH] [3.x][PHP8.5] setAccessible() methods of various Reflection objects have been deprecated https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_reflectionsetaccessible --- src/Event/ApplicationErrorEvent.php | 1 - src/Event/CommandErrorEvent.php | 1 - tests/ApplicationTest.php | 1 - 3 files changed, 3 deletions(-) diff --git a/src/Event/ApplicationErrorEvent.php b/src/Event/ApplicationErrorEvent.php index 1dbb0dbe..2127325f 100644 --- a/src/Event/ApplicationErrorEvent.php +++ b/src/Event/ApplicationErrorEvent.php @@ -104,7 +104,6 @@ public function setExitCode(int $exitCode): void $this->exitCode = $exitCode; $r = new \ReflectionProperty($this->error, 'code'); - $r->setAccessible(true); $r->setValue($this->error, $this->exitCode); } } diff --git a/src/Event/CommandErrorEvent.php b/src/Event/CommandErrorEvent.php index 1e426695..8879ff28 100644 --- a/src/Event/CommandErrorEvent.php +++ b/src/Event/CommandErrorEvent.php @@ -108,7 +108,6 @@ public function setExitCode(int $exitCode): void $this->exitCode = $exitCode; $r = new \ReflectionProperty($this->error, 'code'); - $r->setAccessible(true); $r->setValue($this->error, $this->exitCode); } } diff --git a/tests/ApplicationTest.php b/tests/ApplicationTest.php index 85a6621f..e096525c 100644 --- a/tests/ApplicationTest.php +++ b/tests/ApplicationTest.php @@ -289,7 +289,6 @@ public function testHasGetCommand() // Simulates passing the --help option $r = new \ReflectionObject($this->object); $p = $r->getProperty('wantsHelp'); - $p->setAccessible(true); $p->setValue($this->object, true); /** @var HelpCommand $helpCommand */