-
-
Notifications
You must be signed in to change notification settings - Fork 514
Add support for PHP 8.4 Lazy Objects with configuration flag #2840
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.13.x
Are you sure you want to change the base?
Conversation
421e842
to
cb0b5f6
Compare
… its scanned by several tests
Never implemented in ODM
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 adds support for PHP 8.4 Lazy Objects with a configuration flag, implementing native lazy loading functionality as an alternative to the existing proxy mechanisms. The implementation borrows from the Doctrine ORM approach and introduces a new PropertyAccessor system to handle property access uniformly across different scenarios.
- Introduces native lazy objects support for PHP 8.4+ as a replacement for existing proxy systems
- Replaces the reflection-based property access with a new PropertyAccessor architecture
- Adds comprehensive test coverage for property hooks and lazy object functionality
Reviewed Changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
lib/Doctrine/ODM/MongoDB/Configuration.php | Adds configuration methods for enabling native lazy objects |
lib/Doctrine/ODM/MongoDB/Proxy/Factory/NativeLazyObjectFactory.php | New factory for creating native lazy objects in PHP 8.4+ |
lib/Doctrine/ODM/MongoDB/Mapping/PropertyAccessors/*.php | New PropertyAccessor system replacing direct reflection usage |
lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadata.php | Updated to use PropertyAccessor instead of reflection fields |
lib/Doctrine/ODM/MongoDB/UnitOfWork.php | Updated for native lazy object support and PropertyAccessor usage |
tests/Documents84/ | New test documents for PHP 8.4 property hooks functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
Shamelessly copied from the brilliant work of Benjamin Eberlei on ORM: