Closed nikophil closed 3 months ago
Bundle config diff:
zenstruck_foundry:
- auto_refresh_proxies: null
instantiator:
- without_constructor: false
+ use_constructor: true
allow_extra_attributes: false
always_force_properties: false
service: null
+ orm:
+ auto_persist: true
+ reset:
+ connections: [default]
+ entity_managers: [default]
+ mode: schema
+ mongo:
+ auto_persist: true
+ reset:
+ document_managers: [default]
- database_resetter:
- enabled: true
- orm:
- connections: []
- object_managers: []
- reset_mode: schema
- odm:
- object_managers: []
global_state: []
- make_factory:
- default_namespace: Factory
Here's some info on my upgrade to this branch and running rector:
Before: Remaining direct deprecation notices (3342)
After (and issues below fixed):
Issues: Not sure if all these can/should be fixed.
auto_refresh_proxies
https://github.com/zenstruck/foundry/pull/524make_factory
~ (I don't think we should do this)without_constructor
=>use_constructor
database_resetter.enabled
database_resetter.orm|odm
to rootin
Factory`Factory::sequence()
used to acceptiterable|callable
now it only acceptsiterable
Instantiator::withConstructor()
will throw an exception if class's constructor is not publicwithoutPersisting()
& co are only onPersistObjectFactory
Proxy::forceGet()
was mistakenly removed and rector should convert to _get()Factory::faker()
=>faker()
FactoryCollection::set()
to deprecateInstantiator::forceGet()
to deprecateInstantiator::forceSet()
to deprecaterandomRange()
does not accept0
anymore~ we'll still allow0
in 2.xFactoryCollection::factory()
RepositoryProxy::findOneBy()
second argument$orderBy
should be deprecatedModelFactory::new()
used to accept string (should we deprecate this?)RepositoryDecorator
methods now returnsT
and notProxy
EDIT: I think the two following are ok-ish: for the first problem. Both problems are fixed byt rector rules.
Proxy
,RepositoryProxy
, etc... not sure it is really a problem, but we're not covered by deprecations for this~ I don't think a lot of people type-hintRepositoryProxy
Factory::instantiate()
's return type, althought Ive added#[ReturnTypeWillChange]
~ For the second one: if the problem exist, tests will fail in a very explicit way