@@ -160,18 +160,22 @@ there is an additional argument at the *start* of the list, `Example`. This
160160code is basically saying, "Listen to the 'do' event of the 'Example' target,
161161and, when notified, execute this callback."
162162
163- This is where the ` setIdentifiers() ` argument of ` EventManager ` comes into play.
163+ This is where the ` setIdentifiers() ` method of ` EventManager ` comes into play.
164164The method allows passing an array of strings, defining the names of the context
165165or targets the given instance will be interested in.
166166
167167So, getting back to our example, let's assume that the above shared listener is
168- registered, and also that the ` Example ` class is defined as above. We can then
169- execute the following:
168+ registered, and also that the ` Example ` class is defined as above. (Note that as of
169+ version 3, ` setSharedManager() ` is removed from ` EventManager ` ; the ` SharedEventManager `
170+ instance must instead be injected via the constructor.) We can then execute the following:
170171
171172``` php
172173$example = new Example();
173- $example->getEventManager()->setSharedManager($sharedEvents);
174- $example->do('bar', 'bat');
174+ // prior to version 3:
175+ // $example->getEventManager()->setSharedManager($sharedEvents);
176+ // as of version 3:
177+ $example->setEventManager(new EventManager($sharedEvents));
178+ $example->doIt('bar', 'bat');
175179```
176180
177181and expect the following output:
0 commit comments