@@ -64,6 +64,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
6464 $ scope ,
6565 NullsafeOperatorHelper::getNullsafeShortcircuitedExprRespectingScope ($ scope , $ node ->var ),
6666 sprintf ('Access to property $%s on an unknown class %%s. ' , SprintfHelper::escapeFormatString ($ name )),
67+ // TODO use hasInstanceProperty
6768 static fn (Type $ type ): bool => $ type ->canAccessProperties ()->yes () && $ type ->hasProperty ($ name )->yes (),
6869 );
6970 $ type = $ typeResult ->getType ();
@@ -90,6 +91,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
9091 ];
9192 }
9293
94+ // TODO use hasInstanceProperty
9395 $ has = $ type ->hasProperty ($ name );
9496 if (!$ has ->no () && $ this ->canAccessUndefinedProperties ($ scope , $ node )) {
9597 return [];
@@ -121,12 +123,12 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
121123 $ propertyClassReflection = $ this ->reflectionProvider ->getClass ($ classNames [0 ]);
122124 $ parentClassReflection = $ propertyClassReflection ->getParentClass ();
123125 while ($ parentClassReflection !== null ) {
124- if ($ parentClassReflection ->hasProperty ($ name )) {
126+ if ($ parentClassReflection ->hasInstanceProperty ($ name )) {
125127 if ($ write ) {
126- if ($ scope ->canWriteProperty ($ parentClassReflection ->getProperty ($ name , $ scope ))) {
128+ if ($ scope ->canWriteProperty ($ parentClassReflection ->getInstanceProperty ($ name , $ scope ))) {
127129 return [];
128130 }
129- } elseif ($ scope ->canReadProperty ($ parentClassReflection ->getProperty ($ name , $ scope ))) {
131+ } elseif ($ scope ->canReadProperty ($ parentClassReflection ->getInstanceProperty ($ name , $ scope ))) {
130132 return [];
131133 }
132134
@@ -159,6 +161,7 @@ private function processSingleProperty(Scope $scope, PropertyFetch $node, string
159161 ];
160162 }
161163
164+ // TODO use getInstanceProperty
162165 $ propertyReflection = $ type ->getProperty ($ name , $ scope );
163166 if ($ propertyReflection ->isStatic ()) {
164167 return [
0 commit comments