@@ -72,8 +72,10 @@ public function accepts(Type $type, bool $strictTypes): AcceptsResult
72
72
73
73
public function isSuperTypeOf (Type $ type ): IsSuperTypeOfResult
74
74
{
75
- // TODO
76
- return new IsSuperTypeOfResult ($ type ->hasProperty ($ this ->propertyName ), []);
75
+ return new IsSuperTypeOfResult (
76
+ $ type ->hasInstanceProperty ($ this ->propertyName )->or ($ type ->hasStaticProperty ($ this ->propertyName )),
77
+ [],
78
+ );
77
79
}
78
80
79
81
public function isSubTypeOf (Type $ otherType ): IsSuperTypeOfResult
@@ -88,8 +90,10 @@ public function isSubTypeOf(Type $otherType): IsSuperTypeOfResult
88
90
$ limit = IsSuperTypeOfResult::createMaybe ();
89
91
}
90
92
91
- // TODO
92
- return $ limit ->and (new IsSuperTypeOfResult ($ otherType ->hasProperty ($ this ->propertyName ), []));
93
+ return $ limit ->and (new IsSuperTypeOfResult (
94
+ $ otherType ->hasInstanceProperty ($ this ->propertyName )->or ($ otherType ->hasStaticProperty ($ this ->propertyName )),
95
+ [],
96
+ ));
93
97
}
94
98
95
99
public function isAcceptedBy (Type $ acceptingType , bool $ strictTypes ): AcceptsResult
@@ -122,7 +126,6 @@ public function hasProperty(string $propertyName): TrinaryLogic
122
126
return TrinaryLogic::createMaybe ();
123
127
}
124
128
125
- // TODO
126
129
public function hasInstanceProperty (string $ propertyName ): TrinaryLogic
127
130
{
128
131
if ($ this ->propertyName === $ propertyName ) {
@@ -132,7 +135,6 @@ public function hasInstanceProperty(string $propertyName): TrinaryLogic
132
135
return TrinaryLogic::createMaybe ();
133
136
}
134
137
135
- // TODO
136
138
public function hasStaticProperty (string $ propertyName ): TrinaryLogic
137
139
{
138
140
if ($ this ->propertyName === $ propertyName ) {
0 commit comments