-
Notifications
You must be signed in to change notification settings - Fork 3
Configuration consistency fixes #10
Configuration consistency fixes #10
Conversation
By default all services created through the `get` method were shared, first call creates an instance, and every another call return the previously created instance. Providing service name in "shared" allows to disable this functionality for a specific service. Then every call of the `get` method creates brand new instance of the service. It is possoble to disable shared services by default for all services by using `shared_by_default` option to boolean `false`.
I suggest overriding Alternately, we can simply check that the property is a PSR-11 container, as there's little question how that property is set. |
I think I would prefer the 2nd option, if we override test here it will be hacky solution. |
Okay, those changes are made in the testing repository. |
Allows removing repository, pinning to a (semi-) stable version, and using the shipped abstract class.
I've updated your branch to pin to the stable 0.1.0 release of zend-container-config-test, and updated the shipped test as well to extend |
Thanks, @webimpress! |
It should be compatible with https://github.com/weierophinney/zend-container-config-test and docs https://docs.zendframework.com/zend-expressive/v3/features/container/config/
The main issue is that container passed to the factory is not the same instance as the original container. This problem is because we configure pimple container (non-psr-11) and we wrap it with PSR-11 container when we need and when we pass it into the factories:
https://github.com/webimpress/zend-pimple-config/blob/hotfix/config-consistency/src/Config.php#L93
This PR is based on #6