Closed jdecool closed 6 days ago
Hi @jdecool
I think the problem comes from symfony/var-exporter
https://github.com/symfony/symfony/pull/57460
I'll also fix this in Foundry, we should not try to "proxify" objects that are not orm entities nor odm documents
Thanks @nikophil
I confirm it solves the problem 👍🏼
Thanks @nikophil
This issue is extracted from https://github.com/zenstruck/foundry/issues/626
Using Foundry 2 in a project that uses the
odolbeau/phone-number-bundle
, I've an error trying to generate an entity using aPhoneNumber
class even if the PhoneNumber isn't created through a factory.According to this entity:
And this Foundry factory:
I've this error:
Because Foundry proxy defined a
public function __unserialize(array $data): void
function fromSymfony\Component\VarExporter\LazyProxyTrait
while thePhoneNumber
class definespublic function __unserialize($data): void
I've created a small project to reproduce the bug: https://github.com/jdecool/foundry-bug-demo
You just have to:
composer install
bin/console doctrine:fixtures:load -n
to use the Foundry factory