vendor/netgen/layouts-core/lib/Utils/BackwardsCompatibility/EventDispatcherProxy.php line 19

  1. <?php
  2. declare(strict_types=1);
  3. namespace Netgen\Layouts\Utils\BackwardsCompatibility;
  4. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  5. use Symfony\Component\HttpKernel\Kernel;
  6. final class EventDispatcherProxy
  7. {
  8.     private EventDispatcherInterface $eventDispatcher;
  9.     public function __construct(EventDispatcherInterface $eventDispatcher)
  10.     {
  11.         $this->eventDispatcher $eventDispatcher;
  12.     }
  13.     public function dispatch(object $eventstring $eventName): ?object
  14.     {
  15.         if (Kernel::VERSION_ID >= 40300) {
  16.             return $this->eventDispatcher->dispatch($event$eventName);
  17.         }
  18.         return $this->eventDispatcher->dispatch($eventName$event);
  19.     }
  20. }