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;