@@ -367,8 +367,8 @@ private function addPropertyToClass(ClassLike $class, Node\Stmt\Property $node):
367
367
$ prop ->setReadOnly ((method_exists ($ node , 'isReadonly ' ) && $ node ->isReadonly ()) || ($ class instanceof ClassType && $ class ->isReadOnly ()));
368
368
$ this ->addCommentAndAttributes ($ prop , $ node );
369
369
370
- $ prop ->setAbstract ((bool ) ($ node ->flags & Node \ Stmt \Class_:: MODIFIER_ABSTRACT ));
371
- $ prop ->setFinal ((bool ) ($ node ->flags & Node \ Stmt \Class_:: MODIFIER_FINAL ));
370
+ $ prop ->setAbstract ((bool ) ($ node ->flags & Modifiers:: ABSTRACT ));
371
+ $ prop ->setFinal ((bool ) ($ node ->flags & Modifiers:: FINAL ));
372
372
$ this ->addHooksToProperty ($ prop , $ node );
373
373
}
374
374
}
@@ -480,7 +480,7 @@ private function setupFunction(GlobalFunction|Method|PropertyHook $function, Nod
480
480
if ($ getVisibility || $ setVisibility || $ final ) {
481
481
$ param = $ function ->addPromotedParameter ($ item ->var ->name )
482
482
->setVisibility ($ getVisibility , $ setVisibility )
483
- ->setReadonly (( bool ) ( $ item ->flags & Node \ Stmt \Class_:: MODIFIER_READONLY ))
483
+ ->setReadonly ($ item ->isReadonly ( ))
484
484
->setFinal ($ final );
485
485
$ this ->addHooksToProperty ($ param , $ item );
486
486
} else {
@@ -553,9 +553,9 @@ private function toValue(Node\Expr $node): mixed
553
553
private function toVisibility (int $ flags ): ?string
554
554
{
555
555
return match (true ) {
556
- (bool ) ($ flags & Node \ Stmt \Class_:: MODIFIER_PUBLIC ) => Visibility::Public,
557
- (bool ) ($ flags & Node \ Stmt \Class_:: MODIFIER_PROTECTED ) => Visibility::Protected,
558
- (bool ) ($ flags & Node \ Stmt \Class_:: MODIFIER_PRIVATE ) => Visibility::Private,
556
+ (bool ) ($ flags & Modifiers:: PUBLIC ) => Visibility::Public,
557
+ (bool ) ($ flags & Modifiers:: PROTECTED ) => Visibility::Protected,
558
+ (bool ) ($ flags & Modifiers:: PRIVATE ) => Visibility::Private,
559
559
default => null ,
560
560
};
561
561
}
0 commit comments