Skip to content

Commit 398d4c7

Browse files
committed
Use assert for ambuguous type
1 parent d54bec9 commit 398d4c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Operation/CreateCollection.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
use MongoDB\Exception\InvalidArgumentException;
2626

2727
use function array_is_list;
28+
use function assert;
2829
use function current;
2930
use function is_array;
3031
use function is_bool;
@@ -242,7 +243,9 @@ public function __construct(string $databaseName, string $collectionName, array
242243
}
243244

244245
if (isset($options['pipeline'])) {
245-
if (! array_is_list($options['pipeline'])) {
246+
$pipeline = $options['pipeline'];
247+
assert(is_array($pipeline));
248+
if (! array_is_list($pipeline)) {
246249
throw new InvalidArgumentException('The "pipeline" option is not a list');
247250
}
248251

0 commit comments

Comments
 (0)