File tree Expand file tree Collapse file tree
src/StaticTypeMapper/ValueObject/Type Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,7 +76,10 @@ public function equals(Type $type): bool
7676 return true ;
7777 }
7878
79- return $ type ::class === ObjectType::class
80- && $ type ->getClassName () === $ this ->getClassName ();
79+ if ($ type instanceof self || $ type ::class === ObjectType::class) {
80+ return $ type ->getClassName () === $ this ->getClassName ();
81+ }
82+
83+ return false ;
8184 }
8285}
Original file line number Diff line number Diff line change 44
55namespace Rector \StaticTypeMapper \ValueObject \Type ;
66
7+ use Override ;
78use PHPStan \Type \ObjectType ;
9+ use PHPStan \Type \Type ;
810
911final class NonExistingObjectType extends ObjectType
1012{
13+ #[Override]
14+ public function equals (Type $ type ): bool
15+ {
16+ $ isEqual = parent ::equals ($ type );
17+
18+ if ($ isEqual ) {
19+ return true ;
20+ }
21+
22+ if ($ type instanceof self || $ type ::class === ObjectType::class) {
23+ return $ type ->getClassName () === $ this ->getClassName ();
24+ }
25+
26+ return false ;
27+ }
1128}
You can’t perform that action at this time.
0 commit comments