Skip to content

Mark the definition with the new Document attribute as excluded#970

Merged
GromNaN merged 3 commits intodoctrine:5.6.xfrom
GromNaN:attribute-annotations
Jan 26, 2026
Merged

Mark the definition with the new Document attribute as excluded#970
GromNaN merged 3 commits intodoctrine:5.6.xfrom
GromNaN:attribute-annotations

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Dec 16, 2025

Ensure compatibility with doctrine/mongodb-odm#2933 when the new attribute classes are used.

@GromNaN GromNaN added this to the 5.6.0 milestone Dec 16, 2025
@GromNaN GromNaN requested review from Copilot and jmikola December 16, 2025 17:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the bundle to support the new Attribute classes introduced in doctrine/mongodb-odm 2.16 while maintaining backward compatibility with the existing Annotations classes. The changes ensure that document classes marked with either the old annotation-based or new attribute-based mapping are properly excluded from the Symfony container.

Key Changes:

  • Added support for the new Attribute namespace classes alongside deprecated Annotations classes
  • Refactored autoconfiguration registration to use a loop with conditional class existence checks
  • Updated tests to verify both annotation and attribute variants are excluded from the container

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/DependencyInjection/DoctrineMongoDBExtension.php Refactored autoconfiguration to support both Annotations and Attribute classes with conditional registration
tests/DependencyInjection/DoctrineMongoDBExtensionTest.php Extended test coverage to include new Attribute classes and added conditional test skipping for non-existent classes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GromNaN GromNaN force-pushed the attribute-annotations branch from 8f5c6b2 to 1d1c5ad Compare December 18, 2025 15:50
Copy link
Copy Markdown
Member

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to remove the composer-options in the static analysis workflow without soliciting an additional review.

@GromNaN GromNaN merged commit 0de651c into doctrine:5.6.x Jan 26, 2026
14 checks passed
@GromNaN GromNaN deleted the attribute-annotations branch January 26, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants