Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Aug 25, 2024
2 parents c70b2f7 + fab6891 commit e082eff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/php/lang/reflection/Property.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function modifiers($hook= null) {
*/
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) {
Expand All @@ -94,6 +97,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;
Expand Down

0 comments on commit e082eff

Please sign in to comment.