Skip to content

Commit

Permalink
Merge branch '5.0.x' into psr6-required
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN authored Dec 12, 2023
2 parents 0bc8c5a + cfeb317 commit a85c7d1
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 146 deletions.
51 changes: 0 additions & 51 deletions CHANGELOG-4.0.md

This file was deleted.

7 changes: 0 additions & 7 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ public function getConfigTreeBuilder(): TreeBuilder
->scalarNode('persistent_collection_namespace')->defaultValue('PersistentCollections')->end()
->scalarNode('persistent_collection_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/mongodb/PersistentCollections')->end()
->scalarNode('auto_generate_persistent_collection_classes')->defaultValue(ODMConfiguration::AUTOGENERATE_NEVER)->end()
->scalarNode('fixture_loader')
->setDeprecated(
'doctrine/mongodb-odm-bundle',
'4.7',
'The "fixture_loader" option is deprecated and will be dropped in doctrine/mongodb-odm-bundle 5.0.',
)
->end()
->scalarNode('default_document_manager')->end()
->scalarNode('default_connection')->end()
->scalarNode('default_database')->defaultValue('default')->end()
Expand Down
4 changes: 2 additions & 2 deletions DependencyInjection/DoctrineMongoDBExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\Bundle\MongoDBBundle\DependencyInjection;

use Composer\InstalledVersions;
use Doctrine\Bundle\MongoDBBundle\Attribute\AsDocumentListener;
use Doctrine\Bundle\MongoDBBundle\Attribute\MapDocument;
use Doctrine\Bundle\MongoDBBundle\Command\LoadDataFixturesDoctrineODMCommand;
Expand All @@ -18,7 +19,6 @@
use Doctrine\Common\EventSubscriber;
use Doctrine\ODM\MongoDB\DocumentManager;
use InvalidArgumentException;
use Jean85\PrettyVersions;
use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver;
use Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension;
use Symfony\Bridge\Doctrine\Messenger\DoctrineClearEntityManagerWorkerSubscriber;
Expand Down Expand Up @@ -653,7 +653,7 @@ private static function getODMVersion(): string
{
if (self::$odmVersion === null) {
try {
self::$odmVersion = PrettyVersions::getVersion('doctrine/mongodb-odm')->getPrettyVersion();
self::$odmVersion = InstalledVersions::getPrettyVersion('doctrine/mongodb-odm') ?? 'no version';
} catch (Throwable) {
return 'unknown';
}
Expand Down
16 changes: 0 additions & 16 deletions Tests/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Doctrine\Bundle\MongoDBBundle\Tests\DependencyInjection;

use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Configuration;
use Doctrine\Bundle\MongoDBBundle\Loader\SymfonyFixturesLoader;
use Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Filter\BasicFilter;
use Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Filter\ComplexFilter;
use Doctrine\Bundle\MongoDBBundle\Tests\Fixtures\Filter\DisabledFilter;
Expand Down Expand Up @@ -512,19 +511,4 @@ public function testNullReplicaSetValue(): void
$processedConfig = $processor->processConfiguration($configuration, [$config]);
$this->assertFalse(array_key_exists('replicaSet', $processedConfig['connections']['conn1']['options']));
}

/** @group legacy */
public function testFixtureLoaderDeprecated(): void
{
$config = [
'fixture_loader' => SymfonyFixturesLoader::class,
];

$processor = new Processor();
$configuration = new Configuration();

$this->expectDeprecation('Since doctrine/mongodb-odm-bundle 4.7: The "fixture_loader" option is deprecated and will be dropped in doctrine/mongodb-odm-bundle 5.0.');

$processor->processConfiguration($configuration, [$config]);
}
}
5 changes: 3 additions & 2 deletions Tests/Form/Type/GuesserTestType.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('name')
->add('date')
->add('ts')
// Not setting "date_widget" is deprecated in Symfony 6.4
->add('date', null, ['date_widget' => 'single_text'])
->add('ts', null, ['date_widget' => 'single_text'])
->add('categories', null, ['document_manager' => $options['dm']])
->add('boolField')
->add('floatField')
Expand Down
1 change: 0 additions & 1 deletion Tests/Form/Type/TypeGuesserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ protected function tearDown(): void
parent::tearDown();
}

/** @group legacy */
public function testTypesShouldBeGuessedCorrectly(): void
{
$form = $this->factory->create(GuesserTestType::class, null, ['dm' => $this->dm]);
Expand Down
5 changes: 0 additions & 5 deletions UPGRADE-3.5.md

This file was deleted.

15 changes: 0 additions & 15 deletions UPGRADE-4.0.md

This file was deleted.

26 changes: 0 additions & 26 deletions UPGRADE-4.4.md

This file was deleted.

7 changes: 0 additions & 7 deletions UPGRADE-4.6.md

This file was deleted.

13 changes: 0 additions & 13 deletions UPGRADE-4.7.md

This file was deleted.

1 change: 1 addition & 0 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ UPGRADE FROM 4.x to 5.0
* Remove `--service` option from `doctrine:mongodb:fixtures:load` command
* Remove automatic injection of the container in fixtures classes implementing
`ContainerAwareInterface`. You should use dependency injection instead.
* Remove the `fixture_loader` configuration
* Metadata cache use a PSR-6 cache pool. Support for Doctrine Cache is dropped.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"require": {
"php": "^8.1",
"ext-mongodb": "^1.5",
"composer-runtime-api": "^2.0",
"doctrine/mongodb-odm": "^2.3",
"doctrine/persistence": "^2.2 || ^3.0",
"jean85/pretty-package-versions": "^1.3.0 || ^2.0.1",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/config": "^5.4 || ^6.2",
"symfony/console": "^5.4 || ^6.2",
Expand Down

0 comments on commit a85c7d1

Please sign in to comment.