File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 66
77use PDOStatement ;
88use PHPStan \ShouldNotHappenException ;
9+ use PHPStan \TrinaryLogic ;
910use PHPStan \Type \ArrayType ;
1011use PHPStan \Type \BenevolentUnionType ;
1112use PHPStan \Type \Constant \ConstantArrayTypeBuilder ;
@@ -145,4 +146,25 @@ public static function createDefaultType(int $fetchType): Type
145146
146147 return self ::newWithBothAndFetchType (new MixedType (), $ fetchType );
147148 }
149+
150+ public function equals (Type $ type ): bool
151+ {
152+ if ($ type instanceof self) {
153+ return $ type ->fetchType === $ this ->fetchType && $ type ->bothType ->equals ($ this ->bothType );
154+ }
155+
156+ return parent ::equals ($ type );
157+ }
158+
159+ public function isSuperTypeOf (Type $ type ): TrinaryLogic
160+ {
161+ if ($ type instanceof self) {
162+ return TrinaryLogic::createFromBoolean (
163+ $ type ->fetchType === $ this ->fetchType
164+ && $ type ->bothType ->equals ($ this ->bothType )
165+ );
166+ }
167+
168+ return parent ::isSuperTypeOf ($ type );
169+ }
148170}
You can’t perform that action at this time.
0 commit comments