From 637a20f4d4795ff7189cc5dcdbe402a9aa3281d6 Mon Sep 17 00:00:00 2001 From: Jano Paetzold Date: Fri, 31 Jul 2026 09:38:02 +0200 Subject: [PATCH] Update: Bump Doctrine to ORM 3 and collections 2 Doctrine ORM 3 removed the annotation driver (handled in prep package B) and requires the entity mappings to be declared explicitly (handled in prep package C). With those in place, raise doctrine/orm to ^3.0 and doctrine/collections to ^2.0. This also pulls in DBAL 4 and persistence 4 as transitive upgrades. The MappedSuperclass mapping and all repositories compile unchanged; Collection/ArrayCollection usage required no changes (generics only). One code fix was needed: AppClassTemplatesTest constructed its EntityManager by passing EventManager to DriverManager::getConnection(), which DBAL 4 no longer accepts. Move the EventManager to the EntityManager constructor instead, which is the correct API in ORM 3 / DBAL 4. --- composer.json | 4 ++-- tests/Resources/AppClassTemplatesTest.php | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 7db6872..2337459 100644 --- a/composer.json +++ b/composer.json @@ -6,8 +6,8 @@ "require": { "php": "^8.2", "ext-mbstring": "*", - "doctrine/collections": "^1.6", - "doctrine/orm": "^2.0", + "doctrine/collections": "^2.0", + "doctrine/orm": "^3.0", "psr/log": "^3.0", "ramsey/uuid": "^4.0", "symfony/config": "^7.0", diff --git a/tests/Resources/AppClassTemplatesTest.php b/tests/Resources/AppClassTemplatesTest.php index fd896a6..f85f7ee 100644 --- a/tests/Resources/AppClassTemplatesTest.php +++ b/tests/Resources/AppClassTemplatesTest.php @@ -42,7 +42,6 @@ protected function setUp(): void $connection = DriverManager::getConnection( ['driver' => 'pdo_sqlite', 'memory' => true], - eventManager: $eventManager, ); $config = ORMSetup::createAttributeMetadataConfiguration( @@ -50,7 +49,7 @@ protected function setUp(): void isDevMode: true, ); - $this->em = new EntityManager($connection, $config); + $this->em = new EntityManager($connection, $config, $eventManager); } /** @test */