Skip to content

Commit 7a2fafc

Browse files
claudef3l1x
authored andcommitted
Fix PHP 8.5 deprecation for ReflectionProperty::setAccessible()
Remove calls to setAccessible() as it has no effect since PHP 8.5 and properties are accessible by default through reflection.
1 parent 24b016e commit 7a2fafc

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/Core/Exception/ExceptionExtra.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ public function withPrevious(Throwable $exception): static
5151
// @phpcs:ignore SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly.ReferencedGeneralException
5252
$reflection = new ReflectionClass(Exception::class);
5353
$property = $reflection->getProperty('previous');
54-
$property->setAccessible(true);
5554
$property->setValue($this, $exception);
56-
$property->setAccessible(false);
5755

5856
return $this;
5957
}

0 commit comments

Comments
 (0)