Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Dec 6, 2025

Follow-up #450

@GromNaN GromNaN added this to the 5.0.0 milestone Dec 6, 2025
@GromNaN GromNaN changed the title Require files loaded by the PHPDriver to return a Closure Require files loaded by the PHPDriver to return a Closure Dec 6, 2025
@GromNaN GromNaN force-pushed the php-config-closure branch from 0f70c20 to 4f61a7e Compare December 6, 2025 22:49
@GromNaN GromNaN requested a review from Copilot December 6, 2025 22:55
Copy link

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 enforces that PHP mapping files loaded by the PHPDriver must return a Closure, removing the deprecated legacy behavior that allowed direct metadata manipulation. This is a breaking change that improves type safety and code consistency.

Key Changes:

  • Removed deprecated fallback code that allowed PHP mapping files to execute without returning a Closure
  • Updated error handling to throw MappingException when files don't return a Closure
  • Removed test cases for the deprecated legacy behavior

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Mapping/Driver/PHPDriver.php Removed deprecated fallback logic and error handling for non-Closure returns
src/Mapping/MappingException.php Added new exception method for invalid PHP mapping files
tests/Mapping/PHPDriverTest.php Updated test to verify exception is thrown for non-Closure files
tests/Mapping/_files/Doctrine.Tests.Persistence.Mapping.PHPTestEntity.php Removed legacy mapping code to support new test expectations
tests/Mapping/_files/Doctrine.Tests.Persistence.Mapping.PHPTestEntityAssert.php Deleted legacy test fixture file
UPGRADE.md Added migration guide with before/after examples

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

@GromNaN GromNaN force-pushed the php-config-closure branch from df9df46 to 21884b3 Compare December 7, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants