@param array $events

@return $this
@throws TransformerException
428788
public function init(array $events)
  {
    try
    {
      $this->addEventListeners($events['listeners'])->addEventSubscribers($events['subscribers']);
    }
    catch (\Exception $e)
    {
      throw new TransformerException($e->getMessage());
    }

    return $this;
  }
365561
protected function removeEventSubscribers(array $subscribers)
  {
    try
    {
      foreach ($subscribers as $subscriber)
      {
        $this->dispatcher->removeSubscriber($this->classBuilder->getObjectInstance($subscriber));
      }
    }
    catch (\Exception $e)
    {
      throw new TransformerException($e->getMessage());
    }

    return $this;
  }
510729
public function createSuccess(array $events = []): EventCollection
    {
        $suiteClass = $this->suiteClass;
        $suiteClass::current()->assert($this->successConfig);

        return new EventSequence($events, $this->callVerifierFactory);
    }
206465
public function checkAnyOrder(...$events): ?EventCollection
    {
        if (!count($events)) {
            return null;
        }

        return $this->assertionRecorder
            ->createSuccess($this->mergeEvents($events));
    }
960925
public GetCognitoEventsResult withEvents(java.util.Map<String, String> events) {
        setEvents(events);
        return this;
    }
707112
public function addEvent($event, array $params = []): self
    {
        $event = $this->wrapperEvent($event, null, $params);

        /** @var $event Event */
        if (($event instanceof EventInterface) && !isset($this->events[$event->getName()])) {
            $this->events[$event->getName()] = $event;
        }

        return $this;
    }
1295431
public function setEvents($events)
    {
        $events = (array)$events;
        foreach ($events as $event) {
            $this->addEvent($event);
        }
    }
915903
public function setEventManager(EventManagerInterface $events)
    {
        $identifiers = array(__CLASS__, get_called_class());
        if (isset($this->eventIdentifier)) {
            if ((is_string($this->eventIdentifier))
                || (is_array($this->eventIdentifier))
                || ($this->eventIdentifier instanceof Traversable)
            ) {
                $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier));
            } elseif (is_object($this->eventIdentifier)) {
                $identifiers[] = $this->eventIdentifier;
            }
            // silently ignore invalid eventIdentifier types
        }
        $events->setIdentifiers($identifiers);
        $this->events = $events;
        return $this;
    }
69932
public function trigger($events, $args = [])
    {
        $args[] = $this;
        if (!is_array($events)) {
            $events = [$events];
        }

        foreach ($events as $event) {
            dispatcher()->trigger(static::class . '.' . $event, $args);
            dispatcher()->trigger(Record::class . '.' . $event, $args);
        }

        return $this;
    }
1318454
public function createSuccess(array $events = []): EventCollection
    {
        Assert::assertThat(true, Assert::isTrue());

        return new EventSequence($events, $this->callVerifierFactory);
    }
1172007
public function setEventManager(EventManagerInterface $events)
    {
        $identifiers = array('Social');
        $events->setIdentifiers($identifiers);
        $this->eventManager = $events;

        return $this;
    }
1057379
protected function filterEvents(array $events)
    {
        if (! $eventName = $this->option('event')) {
            return $events;
        }

        return collect($events)->filter(function ($listeners, $event) use ($eventName) {
            return Str::contains($event, $eventName);
        })->toArray();
    }
914708
public function deleteEvents($events)
    {
        $data = array (
                'token'        => $this->apiToken,
                'content'      => 'event',
                'action'       => 'delete',
                'returnFormat' => 'json',
        );
        
        $data['events'] = $this->processEventsArgument($events, $required = true);
        
        $result = $this->connection->callWithArray($data);
        
        $this->processNonExportResult($result);
        
        return (integer) $result;
    }
368371
private function createEventFromArray(array $data = []): Event
    {
        if (null === $this->serializer) {
            $this->serializer = new PhpArraySerializer();
        }

        /** @var Event $event */
        $event = $this->serializer->deserialize($data);
        return $event;
    }
381250
public function setPreTransforms(iterable $transforms): self
	{
		if (!is_array($transforms)) {
			$transforms = iterator_to_array($transforms, false);
		}

		foreach (array_reverse($transforms) as $transform) {
			$this->assertTransform($transform);
			$this->addTransform($transform);
		}

		return $this;
	}
426798
public function setEventManager(\Zend\EventManager\EventManagerInterface $events)
    {
        $this->events = $events;
        $this->events->setIdentifiers([__CLASS__,get_called_class()]);
        
        return $this;
    }
345458
public function addAllowedEvents(array $eventNames): self
    {
        foreach ($eventNames as $eventName) {
            $this->addAllowedEvent($eventName);
        }

        return $this;
    }