doctrine / data-fixtures

Doctrine2 ORM Data Fixtures Extensions
http://www.doctrine-project.org
MIT License
2.78k stars 224 forks source link

Update ReferenceRepository::getRealClass() to match with doctrine\common #419

Closed mdevlamynck closed 1 year ago

mdevlamynck commented 1 year ago

Fixes #417.

This fixes ReferenceRepository::getRealClass() to match with the behaviour of the equiavlent function in doctrine\common ClassUtils::getRealClass().

greg0ire commented 1 year ago

Can you please add a unit test for this?

stof commented 1 year ago

As this is a naming convention coming from doctrine/persistence, I actually suggest adding an utility in doctrine/persistence (meant to replace the one from doctrine/common) instead of duplicating the logic in each package wanting to remove a dependency on doctrine/common.

mdevlamynck commented 1 year ago

So @stof do you want me to create a separate PR to doctrine/persistence to add that utility then update my this PR?

VincentLanglet commented 1 year ago

As this is a naming convention coming from doctrine/persistence, I actually suggest adding an utility in doctrine/persistence (meant to replace the one from doctrine/common) instead of duplicating the logic in each package wanting to remove a dependency on doctrine/common.

That's a good idea, but I'm not sure it will help here since this library is supporting

"doctrine/persistence": "^1.3.3|^2.0|^3.0"

or it would require to drop both 1 and 2 support.

greg0ire commented 1 year ago

it would require to drop both 1 and 2 support.

Seems fine given the version constraints of v3, as well as the install statistics: https://packagist.org/packages/doctrine/persistence/stats

VincentLanglet commented 1 year ago

For moving ClassUtils to doctrine/persistence I opened https://github.com/doctrine/persistence/pull/326 We will need this to be merged/released first then.