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 */