@@ -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 () ? [] : [
@@ -188,7 +188,7 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
188188 }
189189
190190 $ result = $ result ->and ($ hasProperty );
191- $ otherProperty = $ type ->getProperty ($ propertyName , $ scope );
191+ $ otherProperty = $ type ->getInstanceProperty ($ propertyName , $ scope );
192192 if (!$ otherProperty ->isPublic ()) {
193193 return new AcceptsResult (TrinaryLogic::createNo (), [
194194 sprintf ('Property %s::$%s is not public. ' , $ otherProperty ->getDeclaringClass ()->getDisplayName (), $ propertyName ),
@@ -262,7 +262,7 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
262262 $ result = IsSuperTypeOfResult::createYes ();
263263 $ scope = new OutOfClassScope ();
264264 foreach ($ this ->properties as $ propertyName => $ propertyType ) {
265- $ hasProperty = new IsSuperTypeOfResult ($ type ->hasProperty ($ propertyName ), []);
265+ $ hasProperty = new IsSuperTypeOfResult ($ type ->hasInstanceProperty ($ propertyName ), []);
266266 if ($ hasProperty ->no ()) {
267267 if (in_array ($ propertyName , $ this ->optionalProperties , true )) {
268268 continue ;
@@ -280,7 +280,17 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
280280 }
281281
282282 $ result = $ result ->and ($ hasProperty );
283+ <<<<<<< HEAD
283284 $ otherProperty = $ type ->getProperty ($ propertyName , $ scope );
285+ =======
286+
287+ try {
288+ $ otherProperty = $ type ->getInstanceProperty ($ propertyName , $ scope );
289+ } catch (MissingPropertyFromReflectionException ) {
290+ return $ result ;
291+ }
292+
293+ >>>>>>> a507ab857 (Solve deprecations)
284294 if (!$ otherProperty ->isPublic ()) {
285295 return IsSuperTypeOfResult::createNo ();
286296 }
@@ -373,12 +383,12 @@ public function inferTemplateTypes(Type $receivedType): TemplateTypeMap
373383 $ typeMap = TemplateTypeMap::createEmpty ();
374384 $ scope = new OutOfClassScope ();
375385 foreach ($ this ->properties as $ name => $ propertyType ) {
376- if ($ receivedType ->hasProperty ($ name )->no ()) {
386+ if ($ receivedType ->hasInstanceProperty ($ name )->no ()) {
377387 continue ;
378388 }
379389
380390 try {
381- $ receivedProperty = $ receivedType ->getProperty ($ name , $ scope );
391+ $ receivedProperty = $ receivedType ->getInstanceProperty ($ name , $ scope );
382392 } catch (MissingPropertyFromReflectionException ) {
383393 continue ;
384394 }
@@ -464,10 +474,10 @@ public function traverseSimultaneously(Type $right, callable $cb): Type
464474
465475 $ scope = new OutOfClassScope ();
466476 foreach ($ this ->properties as $ name => $ propertyType ) {
467- if (!$ right ->hasProperty ($ name )->yes ()) {
477+ if (!$ right ->hasInstanceProperty ($ name )->yes ()) {
468478 return $ this ;
469479 }
470- $ transformed = $ cb ($ propertyType , $ right ->getProperty ($ name , $ scope )->getReadableType ());
480+ $ transformed = $ cb ($ propertyType , $ right ->getInstanceProperty ($ name , $ scope )->getReadableType ());
471481 if ($ transformed !== $ propertyType ) {
472482 $ stillOriginal = false ;
473483 }
0 commit comments