Skip to content

Commit e7882bc

Browse files
committed
Note an edge case where is_pipeline() may throw InvalidArgumentException
1 parent a8a180b commit e7882bc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/functions.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,13 @@ function is_first_key_operator($document): bool
234234
/**
235235
* Returns whether an update specification is a valid aggregation pipeline.
236236
*
237+
* Note: this method may propagate an InvalidArgumentException from
238+
* document_or_array() if a Serializable object within the pipeline array
239+
* returns a non-array, non-object value from its bsonSerialize() method.
240+
*
237241
* @internal
238-
* @param mixed $pipeline
242+
* @param array|object $pipeline
243+
* @throws InvalidArgumentException
239244
*/
240245
function is_pipeline($pipeline): bool
241246
{

0 commit comments

Comments
 (0)