You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1007 B

3 years ago
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Contracts\EventDispatcher;
  11. use Psr\EventDispatcher\EventDispatcherInterface as PsrEventDispatcherInterface;
  12. /**
  13. * Allows providing hooks on domain-specific lifecycles by dispatching events.
  14. */
  15. interface EventDispatcherInterface extends PsrEventDispatcherInterface
  16. {
  17. /**
  18. * Dispatches an event to all registered listeners.
  19. *
  20. * @param object $event The event to pass to the event handlers/listeners
  21. * @param string|null $eventName The name of the event to dispatch. If not supplied,
  22. * the class of $event should be used instead.
  23. *
  24. * @return object The passed $event MUST be returned
  25. */
  26. public function dispatch(object $event, string $eventName = null): object;
  27. }