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

Remove deprecated parameters #821

Merged
merged 2 commits into from
Dec 20, 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

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,
GromNaN marked this conversation as resolved.
Show resolved Hide resolved
'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