From fab6891d5eac04bce8fba4b37b3120aea6b1ba97 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sun, 25 Aug 2024 11:40:17 +0200 Subject: [PATCH] QA: Add TODO comment --- src/main/php/lang/reflection/Property.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/php/lang/reflection/Property.class.php b/src/main/php/lang/reflection/Property.class.php index 7fd2a4d..8468521 100755 --- a/src/main/php/lang/reflection/Property.class.php +++ b/src/main/php/lang/reflection/Property.class.php @@ -48,6 +48,9 @@ public function constraint() { */ public function get(?object $instance) { try { + + // TODO: Remove superfluous call to setAccessible() if on PHP8.1+ + // see https://wiki.php.net/rfc/make-reflection-setaccessible-no-op $this->reflect->setAccessible(true); return $this->reflect->getValue($instance); } catch (ReflectionException $e) { @@ -68,6 +71,9 @@ public function get(?object $instance) { */ public function set(?object $instance, $value) { try { + + // TODO: Remove superfluous call to setAccessible() if on PHP8.1+ + // see https://wiki.php.net/rfc/make-reflection-setaccessible-no-op $this->reflect->setAccessible(true); $this->reflect->setValue($instance, $value); return $value;