This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component/EventDispatcher
Fabien Potencier 8b62df7247 changed the EventDispatcher and Event interfaces
The three notification methods do not return the Event instance anymore.

notify() does not return anything
notifyUntil() returns the returned value of the event that has processed the event
filter() returns the filtered value

Upgrading your listeners:
Listeners for notify() and filter() events: nothing to change
Listeners for notifyUntil() events:

Before:

    $event->setReturnValue('foo');
    return true;

After:

    $event->setProcessed();
    return 'foo';

If you notify events, the processing also need to be changed:

For filter() notifications: the filtered value is now available as
the returned value of the filter() method.

For notifyUntil() notifications:

Before:

    $event = $dispatcher->notifyUntil($event);
    if ($event->isProcessed()) {
        $ret = $event->getReturnValue();

        // do something with $ret
    }

After:

    $ret = $dispatcher->notifyUntil($event);
    if ($event->isProcessed()) {
        // do something with $ret
    }
2011-01-26 08:41:59 +01:00
..
EventDispatcherTest.php changed the EventDispatcher and Event interfaces 2011-01-26 08:41:59 +01:00
EventTest.php changed the EventDispatcher and Event interfaces 2011-01-26 08:41:59 +01:00