pluginmanager createOptions for factory instance or service instances
When I use the a the plugin manager i noticed something regarding the creation options.
The plugin manager can be used to pass creation options while getting a service.
$service = $pm->get(’service’, array(...));
However I am confused about the indented behavior of this feature. Looking at the code of createFromInvokable and createFromFactory these options are passed to the constructors of the invokable and the factory. Thus not constantly to the constructor of the service i am trying to retrieve.
This difference isn’t noticeable until you use 'not shared' services and factories together.
call this the first time;
1. factory is created, createOptions are passed to __construct of factory
2. service instance is created, factory may do something useful with createOptions.
call this the first time and some_option is still 1.
1. factory already exists, createOptions are not passed to factory
2. service instance is created, factory may do something useful with incorrect createOptions.
I am not sure if this is intended or not, but this makes more sense to me;