/**
  * @param WebSocketEventsDTO $dto
  * @param $format
  *
  * @return WebSocketEventsDTO
  */
 private function resolveEvents(WebSocketEventsDTO $dto, $format)
 {
     /** @var $event WebSocketEvent */
     foreach ($dto->webSocketEvents as $key => $event) {
         if ($event->type === TextEventInterface::EVENT_TYPE) {
             $dto->webSocketEvents[$key] = $this->factory->getEvent($event, $format);
         } else {
             $dto->webSocketEvents[$key] = $this->factory->getEvent($event);
         }
     }
     return $dto;
 }
 /**
  * @param EventFactoryInterface $factory
  */
 public function addFactory(EventFactoryInterface $factory)
 {
     $this->factories[$factory->getFormat()] = $factory;
     $this->logger->info('added factory ' . $factory->getFormat());
 }
 /**
  * @param EventFactoryInterface $factory
  */
 public function addFactory(EventFactoryInterface $factory)
 {
     $this->factories[$factory->getFormat()] = $factory;
 }