@@ -201,12 +201,11 @@ public function getModifiers(): int
201201 }
202202
203203 // Handle PHP 8.4+ asymmetric visibility modifiers
204- // These constants were introduced in PHP 8.4 for asymmetric property visibility
205- if (defined ('ReflectionProperty::IS_PRIVATE_SET ' ) && $ this ->hasPrivateSetVisibility ()) {
206- $ modifiers += constant ('ReflectionProperty::IS_PRIVATE_SET ' );
207- }
208- if (defined ('ReflectionProperty::IS_PROTECTED_SET ' ) && $ this ->hasProtectedSetVisibility ()) {
209- $ modifiers += constant ('ReflectionProperty::IS_PROTECTED_SET ' );
204+ // In PHP 8.4, readonly properties automatically get IS_PRIVATE_SET flag
205+ // because readonly properties can't be set after initialization
206+ if ($ this ->isReadOnly () && PHP_VERSION_ID >= 80400 ) {
207+ // PHP 8.4 introduced IS_PRIVATE_SET = 2048 for asymmetric visibility
208+ $ modifiers += 2048 ; // ReflectionProperty::IS_PRIVATE_SET
210209 }
211210
212211 return $ modifiers ;
@@ -356,37 +355,6 @@ public function isReadOnly(): bool
356355 return $ this ->propertyOrPromotedParam ->isReadonly () || $ this ->getDeclaringClass ()->isReadOnly ();
357356 }
358357
359- /**
360- * Checks if property has private setter visibility (asymmetric visibility)
361- *
362- * This is a PHP 8.4+ feature where properties can have different visibility
363- * for get/set operations, e.g.: public private(set) $prop
364- *
365- * @return bool Always returns false until nikic/php-parser supports asymmetric visibility syntax
366- * @since PHP 8.4
367- */
368- private function hasPrivateSetVisibility (): bool
369- {
370- // TODO: Implement when nikic/php-parser supports asymmetric visibility syntax
371- // For now, always return false since the parser doesn't support this syntax yet
372- return false ;
373- }
374-
375- /**
376- * Checks if property has protected setter visibility (asymmetric visibility)
377- *
378- * This is a PHP 8.4+ feature where properties can have different visibility
379- * for get/set operations, e.g.: public protected(set) $prop
380- *
381- * @return bool Always returns false until nikic/php-parser supports asymmetric visibility syntax
382- * @since PHP 8.4
383- */
384- private function hasProtectedSetVisibility (): bool
385- {
386- // TODO: Implement when nikic/php-parser supports asymmetric visibility syntax
387- // For now, always return false since the parser doesn't support this syntax yet
388- return false ;
389- }
390358
391359 /**
392360 * {@inheritDoc}
0 commit comments