-
-
Notifications
You must be signed in to change notification settings - Fork 516
Change namespace of attribute classes from Annotations to Attribute
#2933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.16.x
Are you sure you want to change the base?
Conversation
|
This will force users to migrate without offering anything in return, except for consistency in the namespace with other projects (and not yet ORM). We can only do this if ORM also decides to do so. |
|
In fact, ORM don't have this subnamespace (example: |
There was a problem hiding this 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 modernizes the MongoDB ODM library's attribute system by moving attribute classes from the Annotations namespace to the new Attribute namespace. The old Annotations namespace is maintained as a deprecated alias to ensure backward compatibility while guiding users toward the new naming convention.
Key Changes:
- Introduced new
Doctrine\ODM\MongoDB\Mapping\Attributenamespace for all attribute classes - Added deprecation triggers when old
Annotationsnamespace classes are loaded - Updated all test files and internal references to use the new namespace
- Maintained backward compatibility through class aliases
Reviewed changes
Copilot reviewed 300 out of 434 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/Mapping/Attribute/*.php |
New attribute classes in the Attribute namespace with class aliases to Annotations namespace for backward compatibility |
src/Mapping/Annotations/*.php |
Converted to deprecation stubs that trigger warnings and load the new Attribute classes |
tests/**/*.php |
Updated import statements from Annotations to Attribute namespace |
src/Mapping/Driver/*.php |
Updated internal references to use new Attribute namespace |
src/Mapping/ClassMetadata.php |
Updated type hints to reference Attribute namespace |
UPGRADE-2.16.md |
Added migration guide for the namespace change |
phpstan-baseline.neon |
Updated static analysis baseline with new namespace references |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
71eff05 to
5e39484
Compare
Summary
Doctrine\ODM\MongoDB\Mapping\AnnotationstoDoctrine\ODM\MongoDB\Mapping\AttributeAnnotationsnamespace is loaded using the autoloader.