forked from fzaninotto/Faker
-
Notifications
You must be signed in to change notification settings - Fork 425
Closed
Labels
Description
Summary
The current version of faker uses the following classes of Doctrine
Doctrine\Common\Persistence\ObjectManagerDoctrine\Common\Persistence\Mapping\ClassMetadata
As seen here:
https://github.com/FakerPHP/Faker/tree/main/src/Faker/ORM/Doctrine
doctrine/persistence with version 1.3 moved the classes around.
With version 2.0 these aliases were gone, this is when faker will stop working.
We have two options here:
- Release a fix adding a simple alias (same as doctrine/persistence https://github.com/doctrine/persistence/blob/1.3.x/lib/Doctrine/Common/Persistence/ObjectManager.php)
- Add a
conflictincomposer.jsonto avoid installing with doctrine/persistence below ^2.0 and use the new classes.
Versions
| Version | |
|---|---|
| PHP | 7.4.x |
fakerphp/faker |
latest |
Current quickfix
To quickly work around this issue I added these two lines into my tests/bootstrap.php
class_alias(\Doctrine\Persistence\ObjectManager::class, 'Doctrine\Common\Persistence\ObjectManager');
class_alias(\Doctrine\ORM\Mapping\ClassMetadata::class, 'Doctrine\Common\Persistence\Mapping\ClassMetadata');
Reactions are currently unavailable