I think this is a better type system around FactoryCollection
the only problem of this solution is that in userland, for factory collections created from PersistentProxyObjectFactory, phpstan requires that you type it this way: FactoryCollection<Proxy<SomeObject>>
but without this update, all objects created with PersistentProxyObjectFactory::createMany() (or createSequence()) is considered as NOT a proxy.
ie: I had plenty of errors like this:
Call to an undefined method App\Domain\Programming|Zenstruck\Foundry\Persistence\Proxy<App\Domain\Programming>::object()
The PHPStan errors I added to the baseline are still internal to Foundry, and can be added safely
I think this is a better type system around
FactoryCollection
the only problem of this solution is that in userland, for factory collections created from
PersistentProxyObjectFactory
, phpstan requires that you type it this way:FactoryCollection<Proxy<SomeObject>>
but without this update, all objects created with
PersistentProxyObjectFactory::createMany()
(orcreateSequence()
) is considered as NOT a proxy. ie: I had plenty of errors like this:The PHPStan errors I added to the baseline are still internal to Foundry, and can be added safely