doctrine/persistence breaking changes
doctrine/persistence 4.0.0 (November 2, 2024) is its newest release with breaking changes, 167 of them. The first: Removes support for Doctrine Common proxies in doctrine/persistence 4.0.0. Every breaking API change we have recorded in doctrine/persistence on Packagist: 257 breaking changes in 2 versions. Below, its 2 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 4.2.1, released October 13, 2026. MIT license. Source repository
Its 4.0.0 release requires PHP 8.1 or later. PHP end of life dates.
doctrine/persistence 4.0.0 breaking changes
- Removed
Support for Doctrine Common proxies was removed in this BC-breaking release. Code relying on it will no longer work. github.com - Removed
Classes that were deprecated earlier have been removed in this BC-breaking release. Code using them must be migrated. github.com - Removed
This release no longer supports PHP versions below 8.1. Users on older PHP must upgrade PHP before upgrading this package. github.com - Removed
Doctrine\Persistence\Mapping\StaticReflectionService
Doctrine\Persistence\Mapping\StaticReflectionService was removed in doctrine/persistence 4.0.0 packagist.org - Removed
Doctrine\Persistence\Reflection\RuntimePublicReflectionProperty
Use RuntimeReflectionProperty instead. packagist.org - Removed
Doctrine\Persistence\Reflection\TypedNoDefaultRuntimePublicReflectionProperty
Use TypedNoDefaultReflectionProperty instead. packagist.org - Removed
StaticReflectionService
The StaticReflectionService class was removed in this BC-breaking release. Code that uses it must stop using it. github.com - Signature changed
A method signature was changed to match the real declared signature in this BC-breaking release. Code relying on the old signature may need updating. github.com - Signature changed
Doctrine\Persistence\AbstractManagerRegistry::__construct
Was public function __construct(string $name, array $connections, array $managers, string $defaultConnection, string $defaultManager, string $proxyInterfaceName); now public function __construct(private readonly string $name, private array... packagist.org - Signature changed
Doctrine\Persistence\AbstractManagerRegistry::getName
Was public function getName(); now public function getName(): string. packagist.org - Signature changed
Doctrine\Persistence\AbstractManagerRegistry::getService
Was abstract protected function getService(string $name); now abstract protected function getService(string $name): object. packagist.org - Signature changed
Doctrine\Persistence\AbstractManagerRegistry::resetService
Was abstract protected function resetService(string $name); now abstract protected function resetService(string $name): void. packagist.org - Signature changed
Doctrine\Persistence\ConnectionRegistry::getConnection
Was public function getConnection(?string $name = null); now public function getConnection(string|null $name = null): object. packagist.org - Signature changed
Doctrine\Persistence\ConnectionRegistry::getConnectionNames
Was public function getConnectionNames(); now public function getConnectionNames(): array. packagist.org - Signature changed
Doctrine\Persistence\ConnectionRegistry::getConnections
Was public function getConnections(); now public function getConnections(): array. packagist.org - Signature changed
Doctrine\Persistence\ConnectionRegistry::getDefaultConnectionName
Was public function getDefaultConnectionName(); now public function getDefaultConnectionName(): string. packagist.org - Signature changed
Doctrine\Persistence\Event\LifecycleEventArgs::__construct
Was public function __construct(object $object, ObjectManager $objectManager); now public function __construct(private readonly object $object, private readonly ObjectManager $objectManager). packagist.org - Signature changed
Doctrine\Persistence\Event\LifecycleEventArgs::getObject
Was public function getObject(); now public function getObject(): object. packagist.org - Signature changed
Doctrine\Persistence\Event\LifecycleEventArgs::getObjectManager
Was public function getObjectManager(); now public function getObjectManager(): ObjectManager. packagist.org - Signature changed
Doctrine\Persistence\Event\LoadClassMetadataEventArgs::__construct
Was public function __construct(ClassMetadata $classMetadata, ObjectManager $objectManager); now public function __construct(private readonly ClassMetadata $classMetadata, private readonly ObjectManager $objectManager). packagist.org - Signature changed
Doctrine\Persistence\Event\LoadClassMetadataEventArgs::getClassMetadata
Was public function getClassMetadata(); now public function getClassMetadata(): ClassMetadata. packagist.org - Signature changed
Doctrine\Persistence\Event\LoadClassMetadataEventArgs::getObjectManager
Was public function getObjectManager(); now public function getObjectManager(): ObjectManager. packagist.org - Signature changed
Doctrine\Persistence\Event\ManagerEventArgs::__construct
Was public function __construct(ObjectManager $objectManager); now public function __construct(private readonly ObjectManager $objectManager). packagist.org - Signature changed
Doctrine\Persistence\Event\ManagerEventArgs::getObjectManager
Was public function getObjectManager(); now public function getObjectManager(): ObjectManager. packagist.org - Signature changed
Doctrine\Persistence\Event\OnClearEventArgs::__construct
Was public function __construct(ObjectManager $objectManager); now public function __construct(private readonly ObjectManager $objectManager). packagist.org - Signature changed
Doctrine\Persistence\Event\OnClearEventArgs::getObjectManager
Was public function getObjectManager(); now public function getObjectManager(): ObjectManager. packagist.org - Signature changed
Doctrine\Persistence\Event\PreUpdateEventArgs::getEntityChangeSet
Was public function getEntityChangeSet(); now public function getEntityChangeSet(): array. packagist.org - Signature changed
Doctrine\Persistence\Event\PreUpdateEventArgs::getNewValue
Was public function getNewValue(string $field); now public function getNewValue(string $field): mixed. packagist.org - Signature changed
Doctrine\Persistence\Event\PreUpdateEventArgs::getOldValue
Was public function getOldValue(string $field); now public function getOldValue(string $field): mixed. packagist.org - Signature changed
Doctrine\Persistence\Event\PreUpdateEventArgs::hasChangedField
Was public function hasChangedField(string $field); now public function hasChangedField(string $field): bool. packagist.org - Signature changed
Doctrine\Persistence\Event\PreUpdateEventArgs::setNewValue
Was public function setNewValue(string $field, $value); now public function setNewValue(string $field, mixed $value): void. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::getDefaultManagerName
Was public function getDefaultManagerName(); now public function getDefaultManagerName(): string. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::getManager
Was public function getManager(?string $name = null); now public function getManager(string|null $name = null): ObjectManager. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::getManagerForClass
Was public function getManagerForClass(string $class); now public function getManagerForClass(string $class): ObjectManager|null. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::getManagerNames
Was public function getManagerNames(); now public function getManagerNames(): array. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::getManagers
Was public function getManagers(); now public function getManagers(): array. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::getRepository
Was public function getRepository(string $persistentObject, ?string $persistentManagerName = null); now public function getRepository(string $persistentObject, string|null $persistentManagerName = null): ObjectRepository. packagist.org - Signature changed
Doctrine\Persistence\ManagerRegistry::resetManager
Was public function resetManager(?string $name = null); now public function resetManager(string|null $name = null): ObjectManager. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::$cacheSalt
Was protected $cacheSalt; now protected string $cacheSalt. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::$initialized
Was protected $initialized; now protected bool $initialized. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::doLoadMetadata
Was abstract protected function doLoadMetadata(ClassMetadata $class, ?ClassMetadata $parent, bool $rootEntityFound, array $nonSuperclassParents); now abstract protected function doLoadMetadata(ClassMetadata $class, ClassMetadata|null... packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getDriver
Was abstract protected function getDriver(); now abstract protected function getDriver(): MappingDriver. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getLoadedMetadata
Was public function getLoadedMetadata(); now public function getLoadedMetadata(): array. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getParentClasses
Was protected function getParentClasses(string $name); now protected function getParentClasses(string $name): array. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getReflectionService
Was public function getReflectionService(); now public function getReflectionService(): ReflectionService. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::initialize
Was abstract protected function initialize(); now abstract protected function initialize(): void. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::initializeReflection
Was abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService); now abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService): void. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::isEntity
Was abstract protected function isEntity(ClassMetadata $class); now abstract protected function isEntity(ClassMetadata $class): bool. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::loadMetadata
Was protected function loadMetadata(string $name); now protected function loadMetadata(string $name): array. packagist.org - Signature changed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::newClassMetadataInstance
Was abstract protected function newClassMetadataInstance(string $className); now abstract protected function newClassMetadataInstance(string $className): ClassMetadata. packagist.org
And 117 more in this version. Sign up to see every change
doctrine/persistence 3.0.0 breaking changes
- Removed
Methods related to partial clearing of the object manager were removed. Code calling them must be updated. github.com - Removed
Support for doctrine/cache was removed. Code relying on it must move to another cache setup. github.com - Removed
Doctrine\Common\Persistence\PersistentObject
Doctrine\Common\Persistence\PersistentObject was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\Event\LifecycleEventArgs::getEntity
Doctrine\Persistence\Event\LifecycleEventArgs::getEntity was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\Event\OnClearEventArgs::clearsAllEntities
Doctrine\Persistence\Event\OnClearEventArgs::clearsAllEntities was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\Event\OnClearEventArgs::getEntityClass
Doctrine\Persistence\Event\OnClearEventArgs::getEntityClass was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\ManagerRegistry::getAliasNamespace
Doctrine\Persistence\ManagerRegistry::getAliasNamespace was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getCacheDriver
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getCacheDriver was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getFqcnFromAlias
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::getFqcnFromAlias was removed in doctrine/persistence 3.0.0 packagist.org - Removed
Doctrine\Persistence\Mapping\AbstractClassMetadataFactory::setCacheDriver
Use setCache instead. packagist.org
And 80 more in this version. Sign up to see every change
Related packages
- doctrine/annotations
- doctrine/coding-standard
- doctrine/collections
- doctrine/dbal
- doctrine/doctrine-bundle
- doctrine/doctrine-fixtures-bundle
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.