Closed jrushlow closed 2 months ago
Have not dived into yet, but i looks like we need to use reflection to check if there are any constructor arguments (at a minimum, mandatory arguments) right before we call: https://github.com/zenstruck/foundry/blob/d38568f633fddde8065318e1d68c29e9edd32913/src/ModelFactoryManager.php#L40
Then grab those services from the container and instantiate the service. This is of course assuming that ObjectFactory
is meant to handle factories w/ services in 2.x. Otherwise rector should check for constructor args, and change ModelFactory
to PersistentProxyObjectFactory
?
Upgrade w/ rector:
PHPUnit Output: