Skip to content

Conversation

@bobvandevijver
Copy link
Contributor

I'm not completely happy with my method of detecting ORM v2 (it uses the presence of a removed method in v3), but it works. Fixes #1844.

@bobvandevijver bobvandevijver force-pushed the mapping-pass branch 2 times, most recently from d42c473 to 82fb7b1 Compare October 24, 2025 06:44
@bobvandevijver bobvandevijver changed the title Fix annotation/attribute driver mapping pass compatibility with ORM 3 Fix attribute driver mapping pass compatibility with ORM 3 Oct 24, 2025
$driverArgs[] = $reportFieldsWhereDeclared;
}

$driver = new Definition(AttributeDriver::class, $driverArgs);
Copy link
Member

Choose a reason for hiding this comment

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

It would be great to cover this method with a test that creates a container, adds the compiler pass returned by this method, compiles it and then attempts to retrieve the driver service from it.

@greg0ire
Copy link
Member

@bobvandevijver do you still plan to work on this?

@bobvandevijver
Copy link
Contributor Author

@greg0ire Thanks for the ping, this completely slipped my mind!

I've added the requested test, I hope it aligns with what you meant!

public function testAttributeDriverIsRegistered(): void
{
$driverNamespace = 'DoctrineBundle\Entity';
$container = $this->createXmlBundleTestContainer(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I re-used this method as the compiler pass requires almost everything to be configured, such as the default entity manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants