You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw new InvalidArgumentException(sprintf('Invalid data type %s received for vector field, expected null, array or MongoDB\BSON\Binary', get_debug_type($value)));
90
-
}
91
-
92
-
if ($value->getType() !== \MongoDB\BSON\Binary::TYPE_VECTOR) {
throw new InvalidArgumentException(sprintf('Invalid binary data of type %d received for vector field, expected binary type %d', $value->getType(), \MongoDB\BSON\Binary::TYPE_VECTOR));
94
-
}
95
-
96
-
if ($value->getVectorType() !== \MongoDB\BSON\VectorType::%%vectorType%%) {
throw new \InvalidArgumentException(sprintf('Invalid binary vector data of vector type %s received for vector field, expected vector type %%vectorType%%', $value->getVectorType()->name));
88
+
} else {
89
+
$return = $value;
98
90
}
99
-
100
-
$return = $value;
101
91
PHP);
102
92
}
103
93
@@ -106,27 +96,17 @@ public function closureToPHP(): string
throw new \InvalidArgumentException(sprintf('Invalid binary vector data of vector type %s received for vector field, expected vector type %%vectorType%%', $value->getVectorType()->name));
@@ -149,4 +151,10 @@ public static function providePHPValueException(): iterable
149
151
yield [newBinary("\x03\x00\x01\x02\x03", Binary::TYPE_GENERIC), 'Invalid binary data of type 0 received for vector field'];
150
152
yield [Binary::fromVector([1, 2, 3], VectorType::Int8), 'Invalid binary vector data of vector type Int8 received for vector field, expected vector type Float32'];
0 commit comments