Skip to content

Commit

Permalink
Require doctrine/persistence 3 (#2603)
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu authored Dec 22, 2023
1 parent bec87ea commit e8a5dd1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 31 deletions.
5 changes: 5 additions & 0 deletions UPGRADE-2.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# UPGRADE FROM 2.6 to 2.7

## doctrine/persistence

* MongoDB ODM 2.7 requires `doctrine/persistence` 3.2 or newer.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"doctrine/collections": "^1.5 || ^2.0",
"doctrine/event-manager": "^1.0 || ^2.0",
"doctrine/instantiator": "^1.1 || ^2",
"doctrine/persistence": "^2.4 || ^3.0",
"doctrine/persistence": "^3.2",
"friendsofphp/proxy-manager-lts": "^1.0",
"jean85/pretty-package-versions": "^1.3.0 || ^2.0.1",
"mongodb/mongodb": "^1.10.0",
Expand Down
3 changes: 2 additions & 1 deletion lib/Doctrine/ODM/MongoDB/Mapping/Driver/AnnotationDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata;
use Doctrine\ODM\MongoDB\Mapping\MappingException;
use Doctrine\Persistence\Mapping\Driver\ColocatedMappingDriver;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use MongoDB\Driver\Exception\UnexpectedValueException;
use ReflectionClass;
use ReflectionMethod;
Expand All @@ -32,7 +33,7 @@
/**
* The AnnotationDriver reads the mapping metadata from docblock annotations.
*/
class AnnotationDriver extends CompatibilityAnnotationDriver
class AnnotationDriver implements MappingDriver
{
use ColocatedMappingDriver;

Expand Down

This file was deleted.

7 changes: 0 additions & 7 deletions tests/Doctrine/ODM/MongoDB/Tests/Functional/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
use Documents\Card;
use Documents\Suit;
use Error;
use Jean85\PrettyVersions;
use MongoDB\BSON\ObjectId;
use ValueError;

use function preg_quote;
use function sprintf;
use function version_compare;

class EnumTest extends BaseTestCase
{
Expand All @@ -36,11 +34,6 @@ public function testPersistNew(): void

public function testArrayOfEnums(): void
{
$persistenceVersion = PrettyVersions::getVersion('doctrine/persistence')->getPrettyVersion();
if (version_compare('3.2.0', $persistenceVersion, '>')) {
self::markTestSkipped('Support for array of enums was introduced in doctrine/persistence 3.2.0');
}

$doc = new Card();
$doc->suits = ['foo' => Suit::Clubs, 'bar' => Suit::Diamonds];

Expand Down

0 comments on commit e8a5dd1

Please sign in to comment.