-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add a BC layer for 2.x #515
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nikophil
changed the title
refactor: deprecate withAttributes() and addState()
refactor: add a BC layer for 2.x
Nov 7, 2023
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 |
nikophil
force-pushed
the
1.x-bc
branch
2 times, most recently
from
January 9, 2024 17:47
99e3dfa
to
188c27a
Compare
kbond
reviewed
Jan 10, 2024
Here's some info on my upgrade to this branch and running rector: Before: After (and issues below fixed): Remaining direct deprecation notices (13) 🎉
Remaining indirect deprecation notices (199)
Issues:
|
nikophil
force-pushed
the
1.x-bc
branch
2 times, most recently
from
February 13, 2024 07:57
4c98640
to
aa01e77
Compare
nikophil
force-pushed
the
1.x-bc
branch
5 times, most recently
from
March 1, 2024 15:55
967932b
to
8e1c317
Compare
nikophil
force-pushed
the
1.x-bc
branch
12 times, most recently
from
March 21, 2024 07:24
97c785e
to
3f71782
Compare
refactor: Foundry 2 BC layer refactor: deprecate ModelFactory refactor: deprecate ModelFactory::getDefaults() refactor: deprecate ModelFactory::getClass() refactor: add #[\ReturnTypeWillChange] to PersistentProxyObjectFactory::initialize() refactor: deprecate proxy class refactor: deprecate stuff in functions.php refactor: deprecate RepositoryProxy refactor: deprecate stuff in Instantiator bot: fix cs [skip ci] minor: deprecate more stuff * refactor: deprecate passing callable to sequence * refactor: deprecate usage of disable/enable_persisting without doctrine * refactor: deprecate TestState for UnitTestConfig bot: fix cs [skip ci] refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final (#518) * refactor: introduce PersistentObjectFactory and deprecate PersistentProxyObjectFactory with final * refactor: introduce persistent_factory() bot: fix cs [skip ci] refactor: deprecate config database_resetter (#523) * refactor: deprecate config database_resetter.orm in favor of orm.reset * refactor: deprecate config database_resetter.odm in favor of mongo.reset bot: fix cs [skip ci] refactor: deprecate config instantiator.without_constructor (#522) bot: fix cs [skip ci] refactor: add BC layer for methods in Instantiator (#535) refactor: change phpstan FactoryCollection return type (#530) bot: fix cs [skip ci] refactor: remove not working BC layer on Factory::__construct() (#529) refactor(bc layer): introduce Proxy interface (#528) bot: fix cs [skip ci] refactor: deprecate config auto_refresh_proxies (#524) bot: fix cs [skip ci] refactor: better deprecations (#541) bot: sync with template [skip ci] bot: fix cs [skip ci] feat: introduce ObjectFactory (#543) bot: fix cs [skip ci] feat: introduce rector rules 🎉 (#544) refactor: create ObjectFactory with make:factory --no-persistence (#546) refactor: more deprecations (#547) * refactor: deprecate Factory::faker() outisde of a factory * refactor: deprecate FactoryCollection::set() bot: fix cs [skip ci] fix: remove directory utils/rector/vendor from git fix: rename Proxy::get() into Proxy::forceGet() fix: rollback BC layer on sequence() attributes fix(rector): handle extending user-defined factory class fix(rector): proxify create() and instantiate() transformation (#549) fix(rector): don't remove ->object() call for create() or instantiate() refctor: deprecate FactoryCollection::factory() (#550) refactor: deprecate using proxy with anonymous class bot: fix cs [skip ci] docs(bc layer): document known BC breaks (#554) refactor: deprecate $orderBy argument in RepositoryDecorator::findOneBy() (#551) fix(rector): bump rector/rector 1.0 fix(bc layer): install php cs fixer for maker bundle (#560) refactor(bc layer): deprecate passing states as string to Factory::new() (#559) bot: fix cs [skip ci] minor: fix some types for sca rector: remove un-needed Factory<Proxy<>> php docs rector: migrate old proxy phpdoc to generic ones rector: use getName() instead of cast to string nodes rector: fix @method parameters rendering bc: deprecate config auto_refresh_proxies bc: introduce ProxyRepositoryDecorator bot: fix cs [skip ci] fix(proxy): assert object is not scheduled for insert before throwing in _refresh minor(rector): change doc to comply to rector 1.0 bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh() bot: fix cs [skip ci] bc: throw deprecation when calling Configuration::disableDefaultProxyAutoRefresh() bc: add repo class in ProxyRepositoryDecorator @methods in rector + maker bot: fix cs [skip ci] bc: fix Proxy sca problem in ModelFactory bot: fix cs [skip ci] bc: fix Proxy sca problem in ModelFactory bot: fix cs [skip ci] bc: fix PersistentObjectFactory @methods fix(bc): add missing import bc(rector): remove useless "unproxify" array_map bc(rector): fix factories @method phpdoc bc(rector): clean rector bot: fix cs [skip ci]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
auto_refresh_proxies
refactor: deprecate config auto_refresh_proxies #524Remove(I don't think we should do this)make_factory
without_constructor
=>use_constructor
database_resetter.enabled
database_resetter.orm|odm
to rootObject Instantiator split into Instantiator/Hydrator(actually nothing to do here)__construct() removed__construct()
inFactory
Factory::sequence()
used to acceptiterable|callable
now it only acceptsiterable
Zenstruck\Foundry\anonymous() -> Zenstruck\Foundry\factory()(factory() will be re-added in 2.x)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 deprecatewe'll still allowrandomRange()
does not accept0
anymore0
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.
no deprecation is thrown around "old" classes likeI don't think a lot of people type-hintProxy
,RepositoryProxy
, etc... not sure it is really a problem, but we're not covered by deprecations for thisRepositoryProxy
deprecation was never thrown aboutFor the second one: if the problem exist, tests will fail in a very explicit wayFactory::instantiate()
's return type, althought Ive added#[ReturnTypeWillChange]