Skip to content

Commit

Permalink
Remove deprecated parameters (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN authored Dec 20, 2023
1 parent e045946 commit 983ec4c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 135 deletions.

This file was deleted.

10 changes: 9 additions & 1 deletion DependencyInjection/DoctrineMongoDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass;
use Doctrine\Bundle\MongoDBBundle\EventSubscriber\EventSubscriberInterface;
use Doctrine\Bundle\MongoDBBundle\Fixture\ODMFixtureInterface;
use Doctrine\Bundle\MongoDBBundle\Mapping\Driver\XmlDriver;
use Doctrine\Bundle\MongoDBBundle\Repository\ServiceDocumentRepositoryInterface;
use Doctrine\Common\DataFixtures\Loader as DataFixturesLoader;
use Doctrine\Common\EventSubscriber;
use Doctrine\ODM\MongoDB\Configuration as ODMConfiguration;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Mapping\Driver\AttributeDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use InvalidArgumentException;
use MongoDB\Client;
use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension;
Expand Down Expand Up @@ -534,7 +537,12 @@ protected function getMappingResourceExtension(): string

protected function getMetadataDriverClass(string $driverType): string
{
return '%' . $this->getObjectManagerElementName('metadata.' . $driverType . '.class') . '%';
return match ($driverType) {
'driver_chain' => MappingDriverChain::class,
'attribute' => AttributeDriver::class,
'xml' => XmlDriver::class,
default => throw new InvalidArgumentException(sprintf('Metadata driver not supported: "%s"', $driverType))
};
}

public function getAlias(): string
Expand Down
2 changes: 0 additions & 2 deletions DoctrineMongoDBBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\CreateHydratorDirectoryPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\CreateProxyDirectoryPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DeprecateChangedClassParametersPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\FixturesCompilerPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\ServiceRepositoryCompilerPass;
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\DoctrineMongoDBExtension;
Expand Down Expand Up @@ -41,7 +40,6 @@ public function build(ContainerBuilder $container): void
$container->addCompilerPass(new DoctrineValidationPass('mongodb'));
$container->addCompilerPass(new ServiceRepositoryCompilerPass());
$container->addCompilerPass(new FixturesCompilerPass());
$container->addCompilerPass(new DeprecateChangedClassParametersPass());

if (! $container->hasExtension('security')) {
return;
Expand Down
16 changes: 0 additions & 16 deletions Resources/config/mongodb.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
use Doctrine\Bundle\MongoDBBundle\Loader\SymfonyFixturesLoader;
use Doctrine\Bundle\MongoDBBundle\ManagerConfigurator;
use Doctrine\Bundle\MongoDBBundle\ManagerRegistry;
use Doctrine\Bundle\MongoDBBundle\Mapping\Driver\XmlDriver;
use Doctrine\Bundle\MongoDBBundle\Repository\ContainerRepositoryFactory;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Mapping\Driver\AttributeDriver;
use Doctrine\ODM\MongoDB\Tools\ResolveTargetDocumentListener;
use Doctrine\Persistence\Mapping\Driver\MappingDriverChain;
use ProxyManager\Proxy\GhostObjectInterface;
use Symfony\Bridge\Doctrine\ContainerAwareEventManager;
use Symfony\Bridge\Doctrine\Security\User\EntityUserProvider;
Expand All @@ -20,19 +17,6 @@
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

return static function (ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->parameters()
->set('doctrine_mongodb.odm.cache.array.class', 'Doctrine\Common\Cache\ArrayCache')
->set('doctrine_mongodb.odm.cache.apc.class', 'Doctrine\Common\Cache\ApcCache')
->set('doctrine_mongodb.odm.cache.apcu.class', 'Doctrine\Common\Cache\ApcuCache')
->set('doctrine_mongodb.odm.cache.memcache.class', 'Doctrine\Common\Cache\MemcacheCache')
->set('doctrine_mongodb.odm.cache.memcache_host', 'localhost')
->set('doctrine_mongodb.odm.cache.memcache_port', 11211)
->set('doctrine_mongodb.odm.cache.memcache_instance.class', 'Memcache')
->set('doctrine_mongodb.odm.cache.xcache.class', 'Doctrine\Common\Cache\XcacheCache')
->set('doctrine_mongodb.odm.metadata.driver_chain.class', MappingDriverChain::class)
->set('doctrine_mongodb.odm.metadata.attribute.class', AttributeDriver::class)
->set('doctrine_mongodb.odm.metadata.xml.class', XmlDriver::class);

$containerConfigurator->services()

->alias(DocumentManager::class, 'doctrine_mongodb.odm.document_manager')
Expand Down

This file was deleted.

4 changes: 4 additions & 0 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ UPGRADE FROM 4.x to 5.0
used directly or extended.
* Remove support of Annotation mapping, you should use Attributes or XML instead.

## Configuration

Remove all `doctrine_mongodb.odm.*` parameters.

## Fixtures

* Remove `--service` option from `doctrine:mongodb:fixtures:load` command
Expand Down

0 comments on commit 983ec4c

Please sign in to comment.