Skip to content

Commit 385e226

Browse files
committed
Update PdoStatementObjectType.php
1 parent 9a01401 commit 385e226

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/PdoReflection/PdoStatementObjectType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ public static function createDefaultType(int $fetchType): Type
147147
return self::newWithBothAndFetchType(new MixedType(), $fetchType);
148148
}
149149

150+
// differentiate objects based on the local properties,
151+
// to make sure TypeCombinator::union() will not normalize separate objects away.
152+
// this means we need to implement equals() and isSuperTypeOf() to compare the local properties.
150153
public function equals(Type $type): bool
151154
{
152155
if ($type instanceof self && $type->fetchType !== null && $type->bothType !== null) {

0 commit comments

Comments
 (0)