@@ -3762,36 +3762,12 @@ private function enterAnonymousFunctionWithoutReflection(
3762
3762
foreach ($ nonStaticExpressions as $ exprString => $ typeHolder ) {
3763
3763
$ expr = $ typeHolder ->getExpr ();
3764
3764
3765
- if (
3766
- !$ expr instanceof PropertyFetch
3767
- ) {
3765
+ if (!$ expr instanceof PropertyFetch) {
3768
3766
continue ;
3769
3767
}
3770
3768
3771
- while ($ expr instanceof PropertyFetch) {
3772
- if ($ expr ->var instanceof Variable) {
3773
- if (
3774
- ! $ expr ->name instanceof Node \Identifier
3775
- || !is_string ($ expr ->var ->name )
3776
- || $ expr ->var ->name !== 'this '
3777
- ) {
3778
- continue 2 ;
3779
- }
3780
- } elseif (!$ expr ->var instanceof PropertyFetch) {
3781
- continue 2 ;
3782
- }
3783
-
3784
- $ propertyReflection = $ this ->propertyReflectionFinder ->findPropertyReflectionFromNode ($ expr , $ this );
3785
- if ($ propertyReflection === null ) {
3786
- continue 2 ;
3787
- }
3788
-
3789
- $ nativePropertyReflection = $ propertyReflection ->getNativeReflection ();
3790
- if ($ nativePropertyReflection === null || !$ nativePropertyReflection ->isReadOnly ()) {
3791
- continue 2 ;
3792
- }
3793
-
3794
- $ expr = $ expr ->var ;
3769
+ if (!$ this ->isReadonlyPropertyFetchOnThis ($ expr )) {
3770
+ continue ;
3795
3771
}
3796
3772
3797
3773
$ expressionTypes [$ exprString ] = $ typeHolder ;
0 commit comments