Skip to content

Commit

Permalink
PHPORM-162 Drop support for Composer 1.x (#2785)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Mikola <[email protected]>
  • Loading branch information
GromNaN and jmikola authored Mar 27, 2024
1 parent fdfb5e5 commit f2d2820
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file.
## [unreleased]

* New aggregation pipeline builder by @GromNaN in [#2738](https://github.com/mongodb/laravel-mongodb/pull/2738)
* Drop support for Composer 1.x by @GromNaN in [#2784](https://github.com/mongodb/laravel-mongodb/pull/2784)

## [4.2.0] - 2024-12-14
## [4.2.0] - 2024-03-14

* Add support for Laravel 11 by @GromNaN in [#2735](https://github.com/mongodb/laravel-mongodb/pull/2735)
* Implement Model::createOrFirst() using findOneAndUpdate operation by @GromNaN in [#2742](https://github.com/mongodb/laravel-mongodb/pull/2742)
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"require": {
"php": "^8.1",
"ext-mongodb": "^1.15",
"composer-runtime-api": "^2.0.0",
"illuminate/support": "^10.0|^11",
"illuminate/container": "^10.0|^11",
"illuminate/database": "^10.30|^11",
Expand Down
13 changes: 4 additions & 9 deletions src/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use MongoDB\Laravel\Concerns\ManagesTransactions;
use Throwable;

use function class_exists;
use function filter_var;
use function implode;
use function is_array;
Expand Down Expand Up @@ -324,14 +323,10 @@ private static function getVersion(): string

private static function lookupVersion(): string
{
if (class_exists(InstalledVersions::class)) {
try {
return self::$version = InstalledVersions::getPrettyVersion('mongodb/laravel-mongodb');
} catch (Throwable) {
return self::$version = 'error';
}
try {
return self::$version = InstalledVersions::getPrettyVersion('mongodb/laravel-mongodb') ?? 'unknown';
} catch (Throwable) {
return self::$version = 'error';
}

return self::$version = 'unknown';
}
}

0 comments on commit f2d2820

Please sign in to comment.