Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Dec 16, 2025

Namespace aliases are not supported by doctrine/persistence since 3.0.0, which is the minimum version required by this bundle.

This means the aliases injected into the configuration are not used. And we deprecated the methods that inject them in doctrine/mongodb-odm#2957

I propose introducing a breaking change, since short aliases no longer work anyway.

Related to symfony/symfony#62792

Fix doctrine/mongodb-odm#2957 (comment)

@GromNaN GromNaN added this to the 5.6.0 milestone Dec 16, 2025
@GromNaN GromNaN added the BC Break Breaking change label Dec 16, 2025
*/
public function __construct(Definition|Reference $driver, array $namespaces, array $managerParameters, string|false $enabledParameter = false, array $aliasMap = [])
public function __construct(Definition|Reference $driver, array $namespaces, array $managerParameters, string|false $enabledParameter = false)
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing a parameter is not a breaking change.

@GromNaN GromNaN merged commit ef8ae0a into doctrine:5.6.x Dec 17, 2025
11 checks passed
@GromNaN GromNaN deleted the aliasMap branch December 17, 2025 10:29
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Dec 19, 2025
…asMap` (GromNaN)

This PR was merged into the 8.1 branch.

Discussion
----------

[DoctrineBridge] Deprecate `RegisterMappingsPass::$aliasMap`

| Q             | A
| ------------- | ---
| Branch?       | 8.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Issues        | -
| License       | MIT

Namespace aliases have been deprecated from `doctrine/persistence` [2.3.0](https://github.com/doctrine/persistence/releases/tag/2.3.0) doctrine/persistence#204, and removed from [3.0.0](doctrine/persistence@7422aab#diff-65217b628918b27724f64d13ef152e91e8d5223c594e564f8583fb2045cb779f).

- DoctrineBundle accepts this parameter, but the method `Configuration::addEntityNamespace` has been removed in `dotrine/orm` 3.0.0, which make it broken. Removing in doctrine/DoctrineMongoDBBundle#971
- DoctrineMongoDBBundle accepts them but the namespace alias support is no longer supported. Removing in doctrine/DoctrineBundle#2169
- DoctrinePHPCRBundle removed usage of this parameter in doctrine/DoctrinePHPCRBundle@dc82197

Projects using the child classes of `RegisterMappingPass` never set an `$aliasMap`.
- [`FOSUserBundle`](https://github.com/FriendsOfSymfony/FOSUserBundle/blob/607a7fb975bc0c39bc2aa7e4ab8c52aded74d63c/src/FOSUserBundle.php#L46-L52)

Removing this parameters is a breaking change but could be already done in 8.1 as it is unsupported or broken for all the Doctrine bundles.

Commits
-------

4ecc888 [DoctrineBridge] Deprecate RegisterMappingsPass::$aliasMap, not supported by ORM and MongoDB ODM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BC Break Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants