@@ -95,6 +95,46 @@ version 2 in version 3. However, we recommend starting to update your
95
95
configuration to remove ` invokables ` entries in favor of factories (and aliases,
96
96
if needed).
97
97
98
+ > #### Invokables and plugin managers
99
+ >
100
+ > If you are creating a plugin manager and in-lining invokables into the class
101
+ > definition, you will need to make some changes.
102
+ >
103
+ > ` $invokableClasses ` will need to become ` $factories ` entries, and you will
104
+ > potentially need to add ` $aliases ` entries.
105
+ >
106
+ > As an example, consider the following, from zend-math v2.x:
107
+ >
108
+ > ``` php
109
+ > class AdapterPluginManager extends AbstractPluginManager
110
+ > {
111
+ > protected $invokableClasses = [
112
+ > 'bcmath' => Adapter\Bcmath::class,
113
+ > 'gmp' => Adapter\Gmp::class,
114
+ > ];
115
+ > }
116
+ > ```
117
+ >
118
+ > Because we no longer define an `$invokableClasses` property, for v3.x, this
119
+ > now becomes:
120
+ >
121
+ > ```php
122
+ > use Zend\ServiceManager\Factory\InvokableFactory;
123
+ >
124
+ > class AdapterPluginManager extends AbstractPluginManager
125
+ > {
126
+ > protected $aliases = [
127
+ > 'bcmath' => Adapter\Bcmath::class,
128
+ > 'gmp' => Adapter\Gmp::class,
129
+ > ];
130
+ >
131
+ > protected $factories = [
132
+ > Adapter\BcMath::class => InvokableFactory::class,
133
+ > Adapter\Gmp::class => InvokableFactory::class,
134
+ > ];
135
+ > }
136
+ > ```
137
+
98
138
### Lazy Services
99
139
100
140
In v2, if you wanted to create a lazy service, you needed to take the following
0 commit comments