diff --git a/en/appendices/6-0-migration-guide.rst b/en/appendices/6-0-migration-guide.rst index 3e9282a418..f708b7104f 100644 --- a/en/appendices/6-0-migration-guide.rst +++ b/en/appendices/6-0-migration-guide.rst @@ -72,6 +72,14 @@ Some methods have also been renamed to better reflect their purpose. These are: * ``Cake\View\Helper\PaginatorHelper`` - ``_numbers()`` has been renamed to ``buildNumbers()`` +Event +----- + +- The signature of ``EventManagerInterface::on()`` has changed. The 2nd and 3rd + parameters have been swapped. Calls which pass an options array as the 2nd + argument will need to be updated to pass it as the 3rd argument instead or + use named parameters. + Datasource ---------- diff --git a/en/core-libraries/events.rst b/en/core-libraries/events.rst index 8af328fac1..26bf6cd1d2 100644 --- a/en/core-libraries/events.rst +++ b/en/core-libraries/events.rst @@ -412,8 +412,8 @@ for event listeners:: $callback = [$this, 'doSomething']; $this->getEventManager()->on( 'Order.afterPlace', + $callback, ['priority' => 2], - $callback ); // Setting priority for a listener