[PR #249] [MERGED] [DCOM-93] Remove Reflection dependency from ClassMetadata #7918

Closed
opened 2026-01-22 15:57:33 +01:00 by admin · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/doctrine/orm/pull/249
Author: @beberlei
Created: 1/2/2012
Status: Merged
Merged: 1/3/2012
Merged by: @beberlei

Base: 2.2Head: DCOM-93


📝 Commits (8)

  • 9bdf9a9 DCOM-93 - Adjust ClassMetadataFactory#getClassParents() to use reflection service.
  • 80408ac DCOM-93 - Add empty initialize and wakeup methods.
  • ea2d4e4 DCOM-93 - Add ClassMetadataFactory#wakeupReflection implementation
  • 1cecc9c DCOM-93 - Factor out __wakeup into a delegate-method from ClassMetadataFactory#wakeupReflection to ClassMetadataInfo#wakeupReflection
  • c7d8c9f DCOM-93 - Factor out ClassMetadata constructor into delegate method initializeReflection
  • 76e4f5a DCOM-93 - Removed reflection dependency from ClassMetadata completly, moving all the code into ClassMetadataInfo for BC reasons.
  • a07fc51 DCOM-93 - Fix docblocks
  • ef8703e DCOM-93 - Allow to check testsuite with any constructor-less cache implementation

📊 Changes

16 files changed (+478 additions, -399 deletions)

View changed files

📝 lib/Doctrine/ORM/Mapping/ClassMetadata.php (+1 -340)
📝 lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php (+65 -8)
📝 lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php (+318 -4)
📝 lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php (+3 -31)
📝 lib/vendor/doctrine-common (+1 -1)
📝 tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php (+1 -1)
📝 tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php (+1 -0)
📝 tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php (+2 -0)
📝 tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php (+2 -1)
📝 tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php (+1 -0)
📝 tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php (+10 -8)
📝 tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php (+59 -2)
📝 tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php (+2 -1)
📝 tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php (+2 -0)
📝 tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php (+5 -1)
📝 tests/Doctrine/Tests/OrmFunctionalTestCase.php (+5 -1)

📄 Description

The Reflection dependency leads to the annoying problem that we have the ClassMetadata deriving from ClassMetadataInfo. This is very bad OO code and has lead to problems on multiple occasions.

This PR removes the dependency by injecting a reflection service, which can be a Static Service not requiring the classes to exist.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/doctrine/orm/pull/249 **Author:** [@beberlei](https://github.com/beberlei) **Created:** 1/2/2012 **Status:** ✅ Merged **Merged:** 1/3/2012 **Merged by:** [@beberlei](https://github.com/beberlei) **Base:** `2.2` ← **Head:** `DCOM-93` --- ### 📝 Commits (8) - [`9bdf9a9`](https://github.com/doctrine/orm/commit/9bdf9a99040637da541a933cbb5b5a2ab617c911) DCOM-93 - Adjust ClassMetadataFactory#getClassParents() to use reflection service. - [`80408ac`](https://github.com/doctrine/orm/commit/80408ac34f9dcb0050d8eee13a54a406616e029c) DCOM-93 - Add empty initialize and wakeup methods. - [`ea2d4e4`](https://github.com/doctrine/orm/commit/ea2d4e4282438e60a7807087e314e940be080255) DCOM-93 - Add ClassMetadataFactory#wakeupReflection implementation - [`1cecc9c`](https://github.com/doctrine/orm/commit/1cecc9c4292a471d6d2028e5576e8021053d49ef) DCOM-93 - Factor out __wakeup into a delegate-method from ClassMetadataFactory#wakeupReflection to ClassMetadataInfo#wakeupReflection - [`c7d8c9f`](https://github.com/doctrine/orm/commit/c7d8c9f34e92cad269d47a6e37deeb8fbf1f1b67) DCOM-93 - Factor out ClassMetadata constructor into delegate method initializeReflection - [`76e4f5a`](https://github.com/doctrine/orm/commit/76e4f5a80bf8faa6e00ec4746c34f2e4bfd4215e) DCOM-93 - Removed reflection dependency from ClassMetadata completly, moving all the code into ClassMetadataInfo for BC reasons. - [`a07fc51`](https://github.com/doctrine/orm/commit/a07fc515c751a2135e98852851a5af76619c290d) DCOM-93 - Fix docblocks - [`ef8703e`](https://github.com/doctrine/orm/commit/ef8703e3e93f57a551e0957cd95aabf298e6151c) DCOM-93 - Allow to check testsuite with any constructor-less cache implementation ### 📊 Changes **16 files changed** (+478 additions, -399 deletions) <details> <summary>View changed files</summary> 📝 `lib/Doctrine/ORM/Mapping/ClassMetadata.php` (+1 -340) 📝 `lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php` (+65 -8) 📝 `lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php` (+318 -4) 📝 `lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php` (+3 -31) 📝 `lib/vendor/doctrine-common` (+1 -1) 📝 `tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php` (+1 -1) 📝 `tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php` (+1 -0) 📝 `tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php` (+2 -0) 📝 `tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php` (+2 -1) 📝 `tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php` (+1 -0) 📝 `tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php` (+10 -8) 📝 `tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php` (+59 -2) 📝 `tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php` (+2 -1) 📝 `tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php` (+2 -0) 📝 `tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php` (+5 -1) 📝 `tests/Doctrine/Tests/OrmFunctionalTestCase.php` (+5 -1) </details> ### 📄 Description The Reflection dependency leads to the annoying problem that we have the ClassMetadata deriving from ClassMetadataInfo. This is very bad OO code and has lead to problems on multiple occasions. This PR removes the dependency by injecting a reflection service, which can be a Static Service not requiring the classes to exist. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-22 15:57:33 +01:00
admin closed this issue 2026-01-22 15:57:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7918