@@ -274,7 +274,7 @@ private function pickProperty(Scope $scope, Type $type, string $name): ?Extended
274274 $ types = [];
275275 if ($ type instanceof UnionType) {
276276 foreach ($ type ->getTypes () as $ innerType ) {
277- if ($ innerType ->hasProperty ($ name )->no ()) {
277+ if ($ innerType ->hasInstanceProperty ($ name )->no ()) {
278278 continue ;
279279 }
280280
@@ -284,15 +284,15 @@ private function pickProperty(Scope $scope, Type $type, string $name): ?Extended
284284
285285 if (count ($ types ) === 0 ) {
286286 try {
287- return $ type ->getProperty ($ name , $ scope );
287+ return $ type ->getInstanceProperty ($ name , $ scope );
288288 } catch (MissingPropertyFromReflectionException ) {
289289 return null ;
290290 }
291291 }
292292
293293 if (count ($ types ) === 1 ) {
294294 try {
295- return $ types [0 ]->getProperty ($ name , $ scope );
295+ return $ types [0 ]->getInstanceProperty ($ name , $ scope );
296296 } catch (MissingPropertyFromReflectionException ) {
297297 return null ;
298298 }
@@ -301,7 +301,7 @@ private function pickProperty(Scope $scope, Type $type, string $name): ?Extended
301301 $ unionType = TypeCombinator::union (...$ types );
302302
303303 try {
304- return $ unionType ->getProperty ($ name , $ scope );
304+ return $ unionType ->getInstanceProperty ($ name , $ scope );
305305 } catch (MissingPropertyFromReflectionException ) {
306306 return null ;
307307 }
0 commit comments