From ab07d7c971877b9eb6532c3be0e1fefce1660f64 Mon Sep 17 00:00:00 2001 From: Timm Friebe Date: Sat, 31 Aug 2024 10:40:16 +0200 Subject: [PATCH] Remove emitProperty() following hooks and asymmetric visibility are both merged See https://github.com/xp-framework/compiler/issues/182#issuecomment-2313491231 --- src/main/php/lang/ast/emit/PHP84.class.php | 26 ---------------------- 1 file changed, 26 deletions(-) diff --git a/src/main/php/lang/ast/emit/PHP84.class.php b/src/main/php/lang/ast/emit/PHP84.class.php index a23910d5..71379f30 100755 --- a/src/main/php/lang/ast/emit/PHP84.class.php +++ b/src/main/php/lang/ast/emit/PHP84.class.php @@ -1,6 +1,5 @@ function($t) { return null; } ]; } - - protected function emitProperty($result, $property) { - static $asymmetric= null; - static $hooks= null; - - // TODO Remove once https://github.com/php/php-src/pull/15063 and - // https://github.com/php/php-src/pull/13455 are merged - if ( - !($asymmetric ?? $asymmetric= method_exists(ReflectionProperty::class, 'isPrivateSet')) && - array_intersect($property->modifiers, ['private(set)', 'protected(set)', 'public(set)']) - ) { - return $this->emitAsymmetricVisibility($result, $property); - } else if ( - !($hooks ?? $hooks= method_exists(ReflectionProperty::class, 'getHooks')) && - $property->hooks - ) { - return $this->emitPropertyHooks($result, $property); - } - - parent::emitProperty($result, $property); - } } \ No newline at end of file