@@ -66,6 +66,10 @@ All notable changes to this project will be documented in this file, in reverse
66
66
Of course, you can still override the ` validate ` method if your logic is more
67
67
complex.
68
68
69
+ To aid migration, ` validate() ` will check for a ` validatePlugin() ` method (which
70
+ was required in v2), and proxy to it if found, after emitting an
71
+ ` E_USER_DEPRECATED ` notice prompting you to rename the method.
72
+
69
73
- A new method, ` configure() ` , was added, allowing full configuration of the
70
74
` ServiceManager ` instance at once. Each of the various configuration methods —
71
75
` setAlias() ` , ` setInvokableClass() ` , etc. — now proxy to this method.
@@ -168,6 +172,14 @@ changes, outlined in this section.
168
172
enforced through the interface, that allows you to easily map multiple service
169
173
names to the same factory.
170
174
175
+ To provide forwards compatibility, the original interfaces have been retained,
176
+ but extend the new interfaces (which are under new namespaces). You can implement
177
+ the new methods in your existing v2 factories in order to make them forwards
178
+ compatible with v3.
179
+
180
+ - The for ` AbstractFactoryInterface ` interface renames the method ` canCreateServiceWithName() `
181
+ to ` canCreate() ` , and merges the ` $name ` and ` $requestedName ` arguments.
182
+
171
183
- Plugin managers will now receive the parent service locator instead of itself
172
184
in factories. In version 2.x, you needed to call the method
173
185
` getServiceLocator() ` to retrieve the parent (application) service locator.
@@ -209,13 +221,21 @@ changes, outlined in this section.
209
221
In practice, this should reduce code, as dependencies often come from the main
210
222
service locator, and not the plugin manager itself.
211
223
224
+ To assist in migration, the method ` getServiceLocator() ` was added to ` ServiceManager `
225
+ to ensure that existing factories continue to work; the method emits an ` E_USER_DEPRECATED `
226
+ message to signal developers to update their factories.
227
+
212
228
- ` PluginManager ` now enforces the need for the main service locator in its
213
229
constructor. In v2.x, people often forgot to set the parent locator, which led
214
230
to bugs in factories trying to fetch dependencies from the parent locator.
215
231
Additionally, plugin managers now pull dependencies from the parent locator by
216
232
default; if you need to pull a peer plugin, your factories will now need to
217
233
pull the corresponding plugin manager first.
218
234
235
+ If you omit passing a service locator to the constructor, your plugin manager
236
+ will continue to work, but will emit a deprecation notice indicatin you
237
+ should update your initialization code.
238
+
219
239
- It's so fast now that your app will fly!
220
240
221
241
## 2.6.1 - TBD
0 commit comments