Skip to content
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

2.x BC Breaks #4

Open
40 tasks
kbond opened this issue Sep 28, 2023 · 2 comments
Open
40 tasks

2.x BC Breaks #4

kbond opened this issue Sep 28, 2023 · 2 comments

Comments

@kbond
Copy link
Owner

kbond commented Sep 28, 2023

Here's a list of 2.x BC breaks. Most can be mitigated with deprecations in 1.x:

  • Bundle configuration
  • Object Instantiator split into Instantiator/Mapper
  • Zenstruck\Foundry\Factory
    • withAttributes() -> with()
    • __construct() removed
  • Zenstruck\Foundry\ModelFactory -> Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory
    • protected function getDefaults(): array -> protected function defaults(): array|callable
    • protected static function getClass(): string -> public static function class(): string
    • protected function initialize() -> protected function initialize(): static
    • addState() -> with()
  • Zenstruck\Foundry\Proxy -> Zenstruck\Foundry\Persistence\Proxy
    • no longer implements \Stringable
    • isPersisted() removed
    • object() -> _real()
    • save() -> _save()
    • remove() -> _delete()
    • refresh() -> _refresh()
    • forceSet() -> _set()
    • forceSetAll() removed
    • forceGet() -> _get()
    • repository() -> _repository()
    • enableAutoRefresh() -> _enableAutoRefresh()
    • disableAutoRefresh() -> _disableAutoRefresh()
    • withoutAutoRefresh() -> _withoutAutoRefresh()
    • assertPersisted() removed
    • assertNotPersisted() removed
  • Zenstruck\Foundry\anonymous() -> Zenstruck\Foundry\factory() (factory() is currently deprecated in 1.x...)
  • Zenstruck\Foundry\create() -> Zenstruck\Foundry\Persistence\persist()
  • Zenstruck\Foundry\create_many() removed
  • Zenstruck\Foundry\instantiate() -> Zenstruck\Foundry\object()
  • Zenstruck\Foundry\instantiate_many() removed
  • Zenstruck\Foundry\repository() -> Zenstruck\Foundry\Persistence\repository()
  • Zenstruck\Foundry\Test\TestState -> Zenstruck\Foundry\Test\UnitTestConfig (better name?)
  • Zenstruck\Foundry\Factory::delayFlush() -> Zenstruck\Foundry\Persistence\flush_after()
  • Zenstruck\Foundry\Test\Factories
    • disablePersist() -> Zenstruck\Foundry\Persistence\disable_persisting()
    • enablePersist() -> Zenstruck\Foundry\Persistence\enable_persisting()
  • Zenstruck\Foundry\Instantiator to Zenstruck\Foundry\Object\Instantiator
    • new Instantiator() => Instantiator::withConstructor()
  • Zenstruck\Foundry\RepositoryProxy to Zenstruck\Foundry\Persistence\RepositoryDecorator
@kbond
Copy link
Owner Author

kbond commented Sep 28, 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

@kbond kbond changed the title 1.x Deprecation TODO 2.x BC Breaks Sep 28, 2023
@nikophil
Copy link
Collaborator

nikophil commented Sep 29, 2023

(added these to above list)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants