@@ -158,7 +158,7 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
158158 $ result = AcceptsResult::createYes ();
159159 $ scope = new OutOfClassScope ();
160160 foreach ($ this ->properties as $ propertyName => $ propertyType ) {
161- $ typeHasProperty = $ type ->hasProperty ($ propertyName );
161+ $ typeHasProperty = $ type ->hasInstanceProperty ($ propertyName );
162162 $ hasProperty = new AcceptsResult (
163163 $ typeHasProperty ,
164164 $ typeHasProperty ->yes () ? [] : [
@@ -183,7 +183,7 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
183183 $ result = $ result ->and ($ hasProperty );
184184
185185 try {
186- $ otherProperty = $ type ->getProperty ($ propertyName , $ scope );
186+ $ otherProperty = $ type ->getInstanceProperty ($ propertyName , $ scope );
187187 } catch (MissingPropertyFromReflectionException ) {
188188 return new AcceptsResult (
189189 $ result ->result ,
@@ -270,7 +270,7 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
270270 $ result = IsSuperTypeOfResult::createYes ();
271271 $ scope = new OutOfClassScope ();
272272 foreach ($ this ->properties as $ propertyName => $ propertyType ) {
273- $ hasProperty = new IsSuperTypeOfResult ($ type ->hasProperty ($ propertyName ), []);
273+ $ hasProperty = new IsSuperTypeOfResult ($ type ->hasInstanceProperty ($ propertyName ), []);
274274 if ($ hasProperty ->no ()) {
275275 if (in_array ($ propertyName , $ this ->optionalProperties , true )) {
276276 continue ;
@@ -284,7 +284,7 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
284284 $ result = $ result ->and ($ hasProperty );
285285
286286 try {
287- $ otherProperty = $ type ->getProperty ($ propertyName , $ scope );
287+ $ otherProperty = $ type ->getInstanceProperty ($ propertyName , $ scope );
288288 } catch (MissingPropertyFromReflectionException ) {
289289 return $ result ;
290290 }
@@ -381,12 +381,12 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
381381 $ typeMap = TemplateTypeMap::createEmpty ();
382382 $ scope = new OutOfClassScope ();
383383 foreach ($ this ->properties as $ name => $ propertyType ) {
384- if ($ receivedType ->hasProperty ($ name )->no ()) {
384+ if ($ receivedType ->hasInstanceProperty ($ name )->no ()) {
385385 continue ;
386386 }
387387
388388 try {
389- $ receivedProperty = $ receivedType ->getProperty ($ name , $ scope );
389+ $ receivedProperty = $ receivedType ->getInstanceProperty ($ name , $ scope );
390390 } catch (MissingPropertyFromReflectionException ) {
391391 continue ;
392392 }
@@ -477,10 +477,10 @@ public function traverseSimultaneously(Type $right, callable $cb): Type
477477
478478 $ scope = new OutOfClassScope ();
479479 foreach ($ this ->properties as $ name => $ propertyType ) {
480- if (!$ right ->hasProperty ($ name )->yes ()) {
480+ if (!$ right ->hasInstanceProperty ($ name )->yes ()) {
481481 return $ this ;
482482 }
483- $ transformed = $ cb ($ propertyType , $ right ->getProperty ($ name , $ scope )->getReadableType ());
483+ $ transformed = $ cb ($ propertyType , $ right ->getInstanceProperty ($ name , $ scope )->getReadableType ());
484484 if ($ transformed !== $ propertyType ) {
485485 $ stillOriginal = false ;
486486 }
0 commit comments