@@ -67,6 +67,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
6767 $ scope ,
6868 NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope ($ scope , $ node ->var ),
6969 sprintf ('Access to property $%s on an unknown class %%s. ' , SprintfHelper::escapeFormatString ($ name )),
70+ // TODO use hasInstanceProperty
7071 static fn (Type $ type ): bool => $ type ->canAccessProperties ()->yes () && $ type ->hasProperty ($ name )->yes (),
7172 );
7273 $ type = $ typeResult ->getType ();
@@ -93,6 +94,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
9394 ];
9495 }
9596
97+ // TODO use hasInstanceProperty
9698 $ has = $ type ->hasProperty ($ name );
9799 if (!$ has ->no () && $ this ->canAccessUndefinedProperties ($ scope , $ node )) {
98100 return [];
@@ -124,12 +126,12 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
124126 $ propertyClassReflection = $ this ->reflectionProvider ->getClass ($ classNames [0 ]);
125127 $ parentClassReflection = $ propertyClassReflection ->getParentClass ();
126128 while ($ parentClassReflection !== null ) {
127- if ($ parentClassReflection ->hasProperty ($ name )) {
129+ if ($ parentClassReflection ->hasInstanceProperty ($ name )) {
128130 if ($ write ) {
129- if ($ scope ->canWriteProperty ($ parentClassReflection ->getProperty ($ name , $ scope ))) {
131+ if ($ scope ->canWriteProperty ($ parentClassReflection ->getInstanceProperty ($ name , $ scope ))) {
130132 return [];
131133 }
132- } elseif ($ scope ->canReadProperty ($ parentClassReflection ->getProperty ($ name , $ scope ))) {
134+ } elseif ($ scope ->canReadProperty ($ parentClassReflection ->getInstanceProperty ($ name , $ scope ))) {
133135 return [];
134136 }
135137
@@ -173,6 +175,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
173175 ];
174176 }
175177
178+ // TODO use getInstanceProperty
176179 $ propertyReflection = $ type ->getProperty ($ name , $ scope );
177180 if ($ propertyReflection ->isStatic ()) {
178181 return [
0 commit comments