Skip to content

Commit ce0979c

Browse files
committed
Drop support for Composer 1.x
1 parent a5ebe88 commit ce0979c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
## [unreleased]
55

6+
* Drop support for Composer 1.x by @GromNaN in [#2784](https://github.com/mongodb/laravel-mongodb/pull/2784)
7+
8+
## [4.2.0] - 2024-03-14
9+
610
* Add support for Laravel 11 by @GromNaN in [#2735](https://github.com/mongodb/laravel-mongodb/pull/2735)
711
* Implement Model::createOrFirst() using findOneAndUpdate operation by @GromNaN in [#2742](https://github.com/mongodb/laravel-mongodb/pull/2742)
812

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"require": {
2525
"php": "^8.1",
2626
"ext-mongodb": "^1.15",
27+
"composer-runtime-api": "^2.0.0",
2728
"illuminate/support": "^10.0|^11",
2829
"illuminate/container": "^10.0|^11",
2930
"illuminate/database": "^10.30|^11",

src/Connection.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use MongoDB\Laravel\Concerns\ManagesTransactions;
1717
use Throwable;
1818

19-
use function class_exists;
2019
use function filter_var;
2120
use function implode;
2221
use function is_array;
@@ -324,14 +323,10 @@ private static function getVersion(): string
324323

325324
private static function lookupVersion(): string
326325
{
327-
if (class_exists(InstalledVersions::class)) {
328-
try {
329-
return self::$version = InstalledVersions::getPrettyVersion('mongodb/laravel-mongodb');
330-
} catch (Throwable) {
331-
return self::$version = 'error';
332-
}
326+
try {
327+
return self::$version = InstalledVersions::getPrettyVersion('mongodb/laravel-mongodb');
328+
} catch (Throwable) {
329+
return self::$version = 'error';
333330
}
334-
335-
return self::$version = 'unknown';
336331
}
337332
}

0 commit comments

Comments
 (0)