8000 Try loading the ùongodb stubs · symfony/symfony@ff8e9ed · GitHub
[go: up one dir, main page]

Skip to content

Commit ff8e9ed

Browse files
committed
Try loading the ùongodb stubs
1 parent 402ca62 commit ff8e9ed

File tree

2 files changed

+14
-4
lines changed
8000

2 files changed

+14
-4
lines changed

src/Symfony/Component/HttpFoundation/Tests/Resources/stubs/mongodb.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@
1111

1212
namespace MongoDB;
1313

14+
use Composer\InstalledVersions;
1415
use MongoDB\Driver\Manager;
1516

17+
if (InstalledVersions::isInstalled('mongodb/mongodb')) {
18+
return;
19+
}
20+
1621
/*
1722
* Stubs for the mongodb/mongodb library version ~1.16
1823
*/
19-
if (!class_exists(Client::class)) {
24+
if (!class_exists(Client::class, false)) {
2025
abstract class Client
2126
{
2227
abstract public function getManager(): Manager;

src/Symfony/Component/Lock/Tests/Resources/stubs/mongodb.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,24 @@
1111

1212
namespace MongoDB;
1313

14+
use Composer\InstalledVersions;
1415
use MongoDB\Driver\Manager;
1516

17+
if (InstalledVersions::isInstalled('mongodb/mongodb')) {
18+
return;
19+
}
20+
1621
/*
1722
* Stubs for the mongodb/mongodb library version ~1.16
1823
*/
19-
if (!class_exists(Client::class)) {
24+
if (!class_exists(Client::class, false)) {
2025
abstract class Client
2126
{
2227
abstract public function getManager(): Manager;
2328
}
2429
}
2530

26-
if (!class_exists(Database::class)) {
31+
if (!class_exists(Database::class, false)) {
2732
abstract class Database
2833
{
2934
abstract public function getManager(): Manager;
@@ -32,7 +37,7 @@ abstract public function getDatabaseName(): string;
3237
}
3338
}
3439

35-
if (!class_exists(Collection::class)) {
40+
if (!class_exists(Collection::class, false)) {
3641
abstract class Collection
3742
{
3843
abstract public function getManager(): Manager;

0 commit comments

Comments
 (0)
0