Skip to content

Commit e9fce4a

Browse files
committed
Compatibility with doctrine/annotations 2
1 parent 094f4e4 commit e9fce4a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Tests/PropertyInfo/DoctrineExtractorTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Doctrine\DBAL\Types\Type as DBALType;
1616
use Doctrine\ORM\EntityManager;
1717
use Doctrine\ORM\Mapping\Column;
18+
use Doctrine\ORM\ORMSetup;
1819
use Doctrine\ORM\Tools\Setup;
1920
use PHPUnit\Framework\TestCase;
2021
use Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor;
@@ -33,7 +34,9 @@ class DoctrineExtractorTest extends TestCase
3334
{
3435
private function createExtractor()
3536
{
36-
$config = Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true);
37+
$config = class_exists(ORMSetup::class)
38+
? ORMSetup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true)
39+
: Setup::createAnnotationMetadataConfiguration([__DIR__.\DIRECTORY_SEPARATOR.'Fixtures'], true);
3740
$entityManager = EntityManager::create(['driver' => 'pdo_sqlite'], $config);
3841

3942
if (!DBALType::hasType('foo')) {

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"symfony/validator": "^5.2|^6.0",
4444
"symfony/translation": "^4.4|^5.0|^6.0",
4545
"symfony/var-dumper": "^4.4|^5.0|^6.0",
46-
"doctrine/annotations": "^1.10.4",
46+
"doctrine/annotations": "^1.10.4|^2",
4747
"doctrine/collections": "^1.0|^2.0",
4848
"doctrine/data-fixtures": "^1.1",
4949
"doctrine/dbal": "^2.13.1|^3.0",

0 commit comments

Comments
 (0)