Skip to content

Commit a14aee5

Browse files
authored
Merge pull request #776 from doctrine/4.5.x-merge-up-into-4.6.x_9JgLVdSd
Merge release 4.5.3 into 4.6.x
2 parents ba28758 + 2d83344 commit a14aee5

File tree

12 files changed

+112
-55
lines changed

12 files changed

+112
-55
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: "Composer Lint"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
paths:
8+
- "composer.json"
9+
push:
10+
branches:
11+
- "*.x"
12+
paths:
13+
- "composer.json"
14+
15+
jobs:
16+
composer-lint:
17+
name: "Composer Lint"
18+
uses: "doctrine/.github/.github/workflows/[email protected]"

.github/workflows/continuous-integration.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
steps:
5656
- name: "Checkout"
57-
uses: "actions/checkout@v2"
57+
uses: "actions/checkout@v3"
5858
with:
5959
fetch-depth: 2
6060

@@ -67,7 +67,7 @@ jobs:
6767
key: "extcache-v1"
6868

6969
- name: Cache extensions
70-
uses: actions/cache@v2
70+
uses: actions/cache@v3
7171
with:
7272
path: ${{ steps.extcache.outputs.dir }}
7373
key: ${{ steps.extcache.outputs.key }}
@@ -97,7 +97,7 @@ jobs:
9797
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
9898

9999
- name: "Upload coverage file"
100-
uses: "actions/upload-artifact@v2"
100+
uses: "actions/upload-artifact@v3"
101101
with:
102102
name: "phpunit-${{ matrix.php-version }}.coverage"
103103
path: "coverage.xml"
@@ -110,16 +110,16 @@ jobs:
110110

111111
steps:
112112
- name: "Checkout"
113-
uses: "actions/checkout@v2"
113+
uses: "actions/checkout@v3"
114114
with:
115115
fetch-depth: 2
116116

117117
- name: "Download coverage files"
118-
uses: "actions/download-artifact@v2"
118+
uses: "actions/download-artifact@v3"
119119
with:
120120
path: "reports"
121121

122122
- name: "Upload to Codecov"
123-
uses: "codecov/codecov-action@v1"
123+
uses: "codecov/codecov-action@v3"
124124
with:
125125
directory: reports

.github/workflows/lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010

1111
steps:
1212
- name: "Checkout"
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414

1515
- name: "DOCtor-RST"
1616
uses: docker://oskarstark/doctor-rst

.github/workflows/release-on-milestone-closed.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
release:
1010
name: "Git tag, release & create merge-up PR"
11-
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@1.4.1"
11+
uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@3.0.0"
1212
secrets:
1313
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
1414
GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }}

.github/workflows/static-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: "Checkout code"
21-
uses: "actions/checkout@v2"
21+
uses: "actions/checkout@v3"
2222

2323
- name: "Install PHP"
2424
uses: "shivammathur/setup-php@v2"
@@ -30,7 +30,7 @@ jobs:
3030
run: "composer config minimum-stability stable"
3131

3232
- name: "Install dependencies with Composer"
33-
uses: "ramsey/composer-install@v1"
33+
uses: "ramsey/composer-install@v2"
3434

3535
- name: "Run a static analysis with vimeo/psalm"
3636
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc) --php-version=${{ matrix.php-version }}"

DependencyInjection/DoctrineMongoDBExtension.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Doctrine\Common\EventSubscriber;
1717
use Doctrine\ODM\MongoDB\DocumentManager;
1818
use InvalidArgumentException;
19+
use Jean85\PrettyVersions;
1920
use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver;
2021
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
2122
use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension;
@@ -33,6 +34,7 @@
3334
use Symfony\Component\DependencyInjection\Reference;
3435
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
3536
use Symfony\Component\Messenger\MessageBusInterface;
37+
use Throwable;
3638

3739
use function array_keys;
3840
use function array_merge;
@@ -49,6 +51,9 @@
4951
*/
5052
class DoctrineMongoDBExtension extends AbstractDoctrineExtension
5153
{
54+
/** @var string */
55+
private static $odmVersion;
56+
5257
/** @internal */
5358
public const CONFIGURATION_TAG = 'doctrine.odm.configuration';
5459

@@ -443,6 +448,11 @@ private function normalizeDriverOptions(array $connection): array
443448
$driverOptions['context'] = new Reference($driverOptions['context']);
444449
}
445450

451+
$driverOptions['driver'] = [
452+
'name' => 'symfony-mongodb',
453+
'version' => self::getODMVersion(),
454+
];
455+
446456
return $driverOptions;
447457
}
448458

@@ -633,4 +643,17 @@ protected function loadCacheDriver(string $cacheName, string $objectManagerName,
633643

634644
return $cacheDriverServiceId;
635645
}
646+
647+
private static function getODMVersion(): string
648+
{
649+
if (self::$odmVersion === null) {
650+
try {
651+
self::$odmVersion = PrettyVersions::getVersion('doctrine/mongodb-odm')->getPrettyVersion();
652+
} catch (Throwable $t) {
653+
return 'unknown';
654+
}
655+
}
656+
657+
return self::$odmVersion;
658+
}
636659
}

Resources/doc/installation.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ following line in the ``config/bundles.php`` file of your project:
4242
.. code-block:: php
4343
4444
// config/bundles.php
45-
<?php
46-
4745
return [
4846
// ...
4947
Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle::class => ['all' => true],

Tests/Command/CommandTestKernel.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\DependencyInjection\ContainerBuilder;
1616
use Symfony\Component\HttpKernel\Kernel;
1717
use Symfony\Component\Routing\Loader\Configurator\RouteConfigurator;
18-
use Symfony\Component\Routing\RouteCollectionBuilder;
1918

2019
use function sys_get_temp_dir;
2120

@@ -32,8 +31,7 @@ public function registerBundles(): array
3231
];
3332
}
3433

35-
/** @param RouteConfigurator|RouteCollectionBuilder $routes */
36-
public function configureRoutes($routes): void
34+
public function configureRoutes(RouteConfigurator $routes): void
3735
{
3836
}
3937

Tests/FixtureIntegrationTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Symfony\Component\DependencyInjection\ContainerBuilder;
2222
use Symfony\Component\HttpKernel\Kernel;
2323
use Symfony\Component\Routing\Loader\Configurator\RouteConfigurator;
24-
use Symfony\Component\Routing\RouteCollectionBuilder;
2524

2625
use function array_map;
2726
use function assert;
@@ -310,8 +309,7 @@ public function addServices(callable $callback): void
310309
$this->servicesCallback = $callback;
311310
}
312311

313-
/** @param RouteConfigurator|RouteCollectionBuilder $routes */
314-
protected function configureRoutes($routes): void
312+
protected function configureRoutes(RouteConfigurator $routes): void
315313
{
316314
}
317315

composer.json

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,65 @@
11
{
22
"name": "doctrine/mongodb-odm-bundle",
3-
"type": "symfony-bundle",
43
"description": "Symfony Doctrine MongoDB Bundle",
5-
"keywords": ["persistence", "mongodb", "symfony"],
6-
"homepage": "http://www.doctrine-project.org",
74
"license": "MIT",
8-
"minimum-stability": "stable",
5+
"type": "symfony-bundle",
6+
"keywords": [
7+
"persistence",
8+
"mongodb",
9+
"symfony"
10+
],
911
"authors": [
10-
{"name": "Bulat Shakirzyanov", "email": "[email protected]"},
11-
{"name": "Kris Wallsmith", "email": "[email protected]"},
12-
{"name": "Jonathan H. Wage", "email": "[email protected]"}
12+
{
13+
"name": "Bulat Shakirzyanov",
14+
"email": "[email protected]"
15+
},
16+
{
17+
"name": "Kris Wallsmith",
18+
"email": "[email protected]"
19+
},
20+
{
21+
"name": "Jonathan H. Wage",
22+
"email": "[email protected]"
23+
}
1324
],
25+
"homepage": "http://www.doctrine-project.org",
1426
"require": {
1527
"php": "^7.4 || ^8.0",
1628
"ext-mongodb": "^1.5",
1729
"doctrine/annotations": "^1.13 || ^2.0",
1830
"doctrine/mongodb-odm": "^2.3",
19-
"doctrine/persistence": "^2.2|^3.0",
20-
"psr/log": "^1.0|^2.0|^3.0",
21-
"symfony/config": "^5.4|^6.2",
22-
"symfony/console": "^5.4|^6.2",
23-
"symfony/dependency-injection": "^5.4|^6.2",
24-
"symfony/deprecation-contracts": "^2.1|^3.0",
25-
"symfony/doctrine-bridge": "^5.4.19|^6.2",
26-
"symfony/framework-bundle": "^5.4|^6.2",
27-
"symfony/http-kernel": "^5.4|^6.2",
28-
"symfony/options-resolver": "^5.4|^6.2"
29-
},
30-
"conflict": {
31-
"doctrine/data-fixtures": "<1.3"
31+
"doctrine/persistence": "^2.2 || ^3.0",
32+
"jean85/pretty-package-versions": "^1.3.0 || ^2.0.1",
33+
"psr/log": "^1.0 || ^2.0 || ^3.0",
34+
"symfony/config": "^5.4 || ^6.2",
35+
"symfony/console": "^5.4 || ^6.2",
36+
"symfony/dependency-injection": "^5.4 || ^6.2",
37+
"symfony/deprecation-contracts": "^2.1 || ^3.0",
38+
"symfony/doctrine-bridge": "^5.4.19 || ^6.2",
39+
"symfony/framework-bundle": "^5.4 || ^6.2",
40+
"symfony/http-kernel": "^5.4 || ^6.2",
41+
"symfony/options-resolver": "^5.4 || ^6.2"
3242
},
3343
"require-dev": {
3444
"doctrine/coding-standard": "^11.0",
3545
"doctrine/data-fixtures": "^1.3",
3646
"phpunit/phpunit": "^9.5.5",
3747
"psalm/plugin-symfony": "^5.0",
38-
"symfony/form": "^5.4|^6.2",
48+
"symfony/form": "^5.4 || ^6.2",
3949
"symfony/phpunit-bridge": "^6.2",
40-
"symfony/security-bundle": "^5.4|^6.2",
41-
"symfony/stopwatch": "^5.4|^6.2",
42-
"symfony/validator": "^5.4|^6.2",
43-
"symfony/yaml": "^5.4|^6.2",
44-
"vimeo/psalm": "^5.6"
50+
"symfony/security-bundle": "^5.4 || ^6.2",
51+
"symfony/stopwatch": "^5.4 || ^6.2",
52+
"symfony/validator": "^5.4 || ^6.2",
53+
"symfony/yaml": "^5.4 || ^6.2",
54+
"vimeo/psalm": "^5.12"
55+
},
56+
"conflict": {
57+
"doctrine/data-fixtures": "<1.3"
4558
},
4659
"suggest": {
4760
"doctrine/data-fixtures": "Load data fixtures"
4861
},
62+
"minimum-stability": "stable",
4963
"autoload": {
5064
"psr-4": {
5165
"Doctrine\\Bundle\\MongoDBBundle\\": ""
@@ -60,9 +74,9 @@
6074
}
6175
},
6276
"config": {
63-
"sort-packages": true,
6477
"allow-plugins": {
6578
"dealerdirect/phpcodesniffer-composer-installer": true
66-
}
79+
},
80+
"sort-packages": true
6781
}
6882
}

0 commit comments

Comments
 (0)