Sin descripción
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.

EventDispatcherInterface.php 1008B

12345678910111213141516171819202122232425262728293031
  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. }