Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 5.0.1 into 5.1.x #281

Merged
merged 4 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"require": {
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"ext-mongodb": "*",
"doctrine/cache": "^1.11 || ^2.0",
"doctrine/doctrine-laminas-hydrator": "^3.3.0",
"doctrine/doctrine-module": "^6.0.4",
"doctrine/event-manager": "^1.2.0 || ^2.0.0",
Expand Down Expand Up @@ -87,8 +88,8 @@
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/package-versions-deprecated": true
"composer/package-versions-deprecated": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"platform": {
"ext-mongodb": "1.11.0"
Expand Down
2 changes: 2 additions & 0 deletions src/Options/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/**
* Configuration options for doctrine mongo
*
* @extends AbstractOptions<int|string|array<string, string>|null>
*/
final class Configuration extends AbstractOptions
{
Expand Down
2 changes: 2 additions & 0 deletions src/Options/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/**
* Connection options for doctrine mongo
*
* @extends AbstractOptions<int|string|array|null>
*/
final class Connection extends AbstractOptions
{
Expand Down
2 changes: 2 additions & 0 deletions src/Options/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/**
* Document manager options for doctrine mongo
*
* @extends AbstractOptions<string>
*/
final class DocumentManager extends AbstractOptions
{
Expand Down
2 changes: 2 additions & 0 deletions src/Options/MongoLoggerCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/**
* Configuration options for a collector
*
* @extends AbstractOptions<string>
*/
final class MongoLoggerCollector extends AbstractOptions
{
Expand Down
4 changes: 3 additions & 1 deletion src/Service/ConfigurationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace DoctrineMongoODMModule\Service;

use Doctrine\Common\Cache\Psr6\CacheAdapter;
use Doctrine\ODM\MongoDB\Configuration;
use Doctrine\ODM\MongoDB\Types\Type;
use DoctrineMongoODMModule\Options;
Expand Down Expand Up @@ -68,7 +69,8 @@ public function __invoke(ContainerInterface $container, $requestedName, array|nu
}

// caching
$config->setMetadataCacheImpl($container->get($configurationOptions->getMetadataCache()));
$cache = $container->get($configurationOptions->getMetadataCache());
$config->setMetadataCache(CacheAdapter::wrap($cache));

// Register filters
foreach ($configurationOptions->getFilters() as $alias => $class) {
Expand Down
3 changes: 2 additions & 1 deletion tests/Doctrine/ConfigurationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace DoctrineMongoODMModuleTest\Doctrine;

use Doctrine\Common\Cache\Cache;
use Doctrine\Common\Cache\Psr6\CacheAdapter;
use Doctrine\ODM\MongoDB\APM\CommandLoggerInterface;
use Doctrine\ODM\MongoDB\Configuration as Config;
use Doctrine\ODM\MongoDB\PersistentCollection\PersistentCollectionFactory;
Expand Down Expand Up @@ -99,7 +100,7 @@ public function testCreation(): void

$this->assertInstanceOf(Config::class, $config);

$this->assertSame($metadataCache, $config->getMetadataCacheImpl());
$this->assertEquals(CacheAdapter::wrap($metadataCache), $config->getMetadataCache());
$this->assertSame($mappingDriver, $config->getMetadataDriverImpl());

$this->assertSame(Config::AUTOGENERATE_EVAL, $config->getAutoGenerateProxyClasses());
Expand Down
Loading