Skip to content

Commit a042591

Browse files
committed
Merge pull request #1586 from lyrixx/patch-event-dispatcher
Fixed typo in cookbook/event_dispatcher/class_extension.rst
2 parents 4b49fbc + d8256d3 commit a042591

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cookbook/event_dispatcher/class_extension.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ magic ``__call()`` method in the class you want to be extended like this:
1717
{
1818
// create an event named 'foo.method_is_not_found'
1919
$event = new HandleUndefinedMethodEvent($this, $method, $arguments);
20-
$this->dispatcher->dispatch($this, 'foo.method_is_not_found', $event);
20+
$this->dispatcher->dispatch('foo.method_is_not_found', $event);
2121
2222
// no listener was able to process the event? The method does not exist
2323
if (!$event->isProcessed()) {
@@ -122,4 +122,4 @@ instance of ``Bar`` with the ``foo.method_is_not_found`` event:
122122
.. code-block:: php
123123
124124
$bar = new Bar();
125-
$dispatcher->addListener('foo.method_is_not_found', $bar);
125+
$dispatcher->addListener('foo.method_is_not_found', array($bar, 'onFooMethodIsNotFound'));

0 commit comments

Comments
 (0)