File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 4242use PHPStan \Type \Enum \EnumCaseObjectType ;
4343use PHPStan \Type \Generic \GenericClassStringType ;
4444use PHPStan \Type \Generic \GenericObjectType ;
45+ use PHPStan \Type \Generic \TemplateType ;
4546use PHPStan \Type \Generic \TemplateTypeHelper ;
4647use PHPStan \Type \Traits \MaybeIterableTypeTrait ;
4748use PHPStan \Type \Traits \NonArrayTypeTrait ;
@@ -625,7 +626,19 @@ public function isSuperTypeOf(Type $type): IsSuperTypeOfResult
625626
626627 public function equals (Type $ type ): bool
627628 {
628- if (get_class ($ type ) !== static ::class) {
629+ if (!$ type instanceof self) {
630+ return false ;
631+ }
632+
633+ if ($ type instanceof EnumCaseObjectType) {
634+ return false ;
635+ }
636+
637+ if ($ type instanceof TemplateType) {
638+ return false ;
639+ }
640+
641+ if ($ type instanceof GenericObjectType && !$ this instanceof GenericObjectType) {
629642 return false ;
630643 }
631644
You can’t perform that action at this time.
0 commit comments