Skip to content

Commit 599bcce

Browse files
committed
Remove Support for ext-mongodb 1
1 parent 3552b4e commit 599bcce

File tree

4 files changed

+3
-28
lines changed

4 files changed

+3
-28
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- dependencies: "lowest"
4343
php-version: "8.1"
4444
mongodb-version: "6.0"
45-
driver-version: "1.21.0"
45+
driver-version: "2.1.0"
4646
topology: "server"
4747
symfony-version: "stable"
4848
proxy: "lazy-ghost"

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
},
2626
"require": {
2727
"php": "^8.1",
28-
"ext-mongodb": "^1.21 || ^2.0",
28+
"ext-mongodb": "^2.0",
2929
"composer-runtime-api": "^2.0",
3030
"doctrine/cache": "^1.11 || ^2.0",
3131
"doctrine/collections": "^1.5 || ^2.0",
3232
"doctrine/event-manager": "^1.0 || ^2.0",
3333
"doctrine/instantiator": "^1.1 || ^2",
3434
"doctrine/persistence": "^3.2 || ^4",
3535
"friendsofphp/proxy-manager-lts": "^1.0",
36-
"mongodb/mongodb": "^1.21.2 || ^2.1.1",
36+
"mongodb/mongodb": "^2.1.1",
3737
"psr/cache": "^1.0 || ^2.0 || ^3.0",
3838
"symfony/console": "^5.4 || ^6.0 || ^7.0",
3939
"symfony/deprecation-contracts": "^2.2 || ^3.0",

phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,18 +1110,6 @@ parameters:
11101110
count: 1
11111111
path: tests/Tests/QueryTest.php
11121112

1113-
-
1114-
message: '#^Instantiated class MongoDB\\Model\\CollectionInfoCommandIterator not found\.$#'
1115-
identifier: class.notFound
1116-
count: 1
1117-
path: tests/Tests/SchemaManagerTest.php
1118-
1119-
-
1120-
message: '#^Instantiated class MongoDB\\Model\\IndexInfoIteratorIterator not found\.$#'
1121-
identifier: class.notFound
1122-
count: 1
1123-
path: tests/Tests/SchemaManagerTest.php
1124-
11251113
-
11261114
message: '#^Method Doctrine\\ODM\\MongoDB\\Tests\\SchemaManagerTest\:\:createCollectionIterator\(\) has parameter \$collections with no value type specified in iterable type array\.$#'
11271115
identifier: missingType.iterableValue

tests/Tests/SchemaManagerTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,7 @@
3737
use MongoDB\Driver\WriteConcern;
3838
use MongoDB\GridFS\Bucket;
3939
use MongoDB\Model\CollectionInfo;
40-
use MongoDB\Model\CollectionInfoCommandIterator;
41-
use MongoDB\Model\CollectionInfoIterator;
4240
use MongoDB\Model\IndexInfo;
43-
use MongoDB\Model\IndexInfoIterator;
44-
use MongoDB\Model\IndexInfoIteratorIterator;
4541
use PHPUnit\Framework\Attributes\DataProvider;
4642
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
4743
use PHPUnit\Framework\Constraint\ArrayHasKey;
@@ -55,7 +51,6 @@
5551
use function array_map;
5652
use function assert;
5753
use function in_array;
58-
use function interface_exists;
5954

6055
/**
6156
* @phpstan-import-type IndexMapping from ClassMetadata
@@ -1483,10 +1478,6 @@ private function createSearchIndexCommandExceptionForOlderServers(): CommandExce
14831478

14841479
private function createIndexIterator(array $indexes = []): Iterator
14851480
{
1486-
if (interface_exists(IndexInfoIterator::class)) {
1487-
return new IndexInfoIteratorIterator(new ArrayIterator($indexes));
1488-
}
1489-
14901481
return new ArrayIterator(array_map(
14911482
static fn (array $indexInfo) => new IndexInfo($indexInfo),
14921483
$indexes,
@@ -1495,10 +1486,6 @@ private function createIndexIterator(array $indexes = []): Iterator
14951486

14961487
private function createCollectionIterator(array $collections = []): Iterator
14971488
{
1498-
if (interface_exists(CollectionInfoIterator::class)) {
1499-
return new CollectionInfoCommandIterator(new ArrayIterator($collections));
1500-
}
1501-
15021489
return new ArrayIterator(array_map(
15031490
static fn (array $collectionInfo) => new CollectionInfo($collectionInfo),
15041491
$collections,

0 commit comments

Comments
 (0)