zenstruck / foundry

A model factory library for creating expressive, auto-completable, on-demand dev/test fixtures with Symfony and Doctrine.
https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html
MIT License
609 stars 63 forks source link

refactor: add a BC layer for 2.x #515

Closed nikophil closed 3 months ago

nikophil commented 7 months ago

EDIT: I think the two following are ok-ish: for the first problem. Both problems are fixed byt rector rules.

nikophil commented 7 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
kbond commented 5 months ago

Here's some info on my upgrade to this branch and running rector:

Before: Remaining direct deprecation notices (3342)

After (and issues below fixed):

Remaining direct deprecation notices (13) :tada: ``` 38x: Since zenstruck/foundry 1.37.0: Calling instance method "Zenstruck\Foundry\Object\Instantiator::withoutConstructor()" is deprecated and will be removed in 2.0. Use static call instead: "Zenstruck\Foundry\Object\Instantiator::withoutConstructor()" instead. 12x: Since zenstruck\foundry 1.37.0: Method "Zenstruck\Foundry\Proxy::object()" is deprecated and will be removed in 2.0. Use "Zenstruck\Foundry\Proxy::_real()" instead. 11x: Since zenstruck\foundry 1.37.0: Method "Zenstruck\Foundry\Proxy::save()" is deprecated and will be removed in 2.0. Use "Zenstruck\Foundry\Proxy::_save()" instead. 9x: Since zenstruck\foundry 1.37.0: Method "Zenstruck\Foundry\Proxy::forceSet()" is deprecated and will be removed in 2.0. Use "Zenstruck\Foundry\Proxy::_set()" instead. 2x: Since zenstruck\foundry 1.37.0: Method "Zenstruck\Foundry\Proxy::forceSetAll()" is deprecated and will be removed in 2.0 without replacement. 1x: Since zenstruck\foundry 1.37.0: Passing a callable to method "Zenstruck\Foundry\Factory::sequence()" is deprecated and will be removed in 2.0. 1x: Since zenstruck\foundry 1.37: Usage of "Zenstruck\Foundry\anonymous()" function is deprecated and will be removed in 2.0. Use the "Zenstruck\Foundry\Persistence\proxy_factory()" function instead. ```
Remaining indirect deprecation notices (199) ``` 175x: Since zenstruck\foundry 1.37.0: Method "Zenstruck\Foundry\Proxy::object()" is deprecated and will be removed in 2.0. Use "Zenstruck\Foundry\Proxy::_real()" instead. 1x: The "Zenstruck\Foundry\Factory::create()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\ObjectFactory". 1x: The "Zenstruck\Foundry\ObjectFactory::new()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\ObjectFactory::create()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\ObjectFactory::createOne()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\ObjectFactory::createSequence()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::findOrCreate()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::first()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::last()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::random()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::randomOrCreate()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::randomSet()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::randomRange()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::all()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::find()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". 1x: The "Zenstruck\Foundry\Persistence\PersistentObjectFactory::findBy()" method is considered final. It may change without further notice as of its next major version. You should not extend it from "Zenstruck\Foundry\Persistence\PersistentProxyObjectFactory". ```

Issues: Not sure if all these can/should be fixed.