vendor/kevinpapst/adminlte-bundle/Controller/EmitterController.php line 31

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the AdminLTE bundle.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. namespace KevinPapst\AdminLTEBundle\Controller;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  11. use Symfony\Contracts\EventDispatcher\Event;
  12. class EmitterController extends AbstractController
  13. {
  14. /**
  15. * @var EventDispatcherInterface
  16. */
  17. protected $eventDispatcher;
  18. public function __construct(EventDispatcherInterface $dispatcher)
  19. {
  20. $this->eventDispatcher = $dispatcher;
  21. }
  22. protected function dispatch(Event $event): Event
  23. {
  24. /** @var Event $event */
  25. $event = $this->eventDispatcher->dispatch($event);
  26. return $event;
  27. }
  28. protected function hasListener(string $eventName): bool
  29. {
  30. return $this->eventDispatcher->hasListeners($eventName);
  31. }
  32. }