@param \Keios\Apparatus\Contracts\Dispatchable $event

@return mixed
550657
public function findHandlerScenarioFor(Dispatchable $event)
    {
        $eventName = $event->getEventName();

        $this->scenarioCache[$eventName] = $this->scenarioFactory->findHandlerScenarioFor($event);

        return $this->scenarioCache[$eventName];
    }
1340925
public function dispatch(Event $event) {

		$this->lastEvent = $event;
		$eventName = $event->getName();

		if (isset($this->registry[$eventName])) {

			foreach ($this->getSortedRegistry($eventName) as $listener) {
				call_user_func($listener, $event);
			}
			
		}

	}
1125886
protected function dispatch(string $name, Event $event = null): Event
    {
        if (empty(self::$dispatchers[static::class])) {
            //We can bypass dispatcher creation
            return $event;
        }

        return static::getEventDispatcher()->dispatch($name, $event);
    }
637509
public function getListeners(string $event) : array
    {
        if (empty($this->listeners[$event])) {
            return [];
        }

        if (! isset($this->sorted[$event])) {
            $this->sorted[$event] = $this->sortListeners($this->listeners[$event]);
        }

        return $this->sorted[$event];
    }
213131
protected function getPayloadFromEvent($event)
    {
        if (method_exists($event, 'broadcastWith')) {
            return $event->broadcastWith();
        }

        $payload = array();

        //
        $reflection = new ReflectionClass($event);

        foreach ($reflection->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
            $key = $property->getName();

            $value = $property->getValue($event);

            $payload[$key] = $this->formatProperty($value);
        }

        return $payload;
    }
491357
private function getSupportedAttribute($event)
    {
        $model = $event->getModel();

        // Not a metamodel model.
        if (!$model instanceof Model) {
            return null;
        }

        $property  = $event->getProperty();
        $attribute = $model->getItem()->getAttribute($property);

        if ($attribute instanceof Timestamp) {
            return $attribute;
        }

        return null;
    }
1006508
public function getRepositoryForEvent($event)
    {
        $repository = null;

        if ($event instanceof DownVoteEvent) {
            $repository = $this->getRepository('Kunstmaan\VotingBundle\Entity\UpDown\DownVote');
        }

        if ($event instanceof UpVoteEvent) {
            $repository = $this->getRepository('Kunstmaan\VotingBundle\Entity\UpDown\UpVote');
        }

        if ($event instanceof LinkedInShareEvent) {
            $repository = $this->getRepository('Kunstmaan\VotingBundle\Entity\LinkedIn\LinkedInShare');
        }

        if ($event instanceof FacebookLikeEvent) {
            $repository = $this->getRepository('Kunstmaan\VotingBundle\Entity\Facebook\FacebookLike');
        }

        if ($event instanceof FacebookSendEvent) {
            $repository = $this->getRepository('Kunstmaan\VotingBundle\Entity\Facebook\FacebookSend');
        }

        return $repository;
    }
1374373
public static function emit($event)
    {
        if (isset(static::$events['__bow.once.event'][$event])) {
            $listener = static::$events['__bow.once.event'][$event];

            $data = array_slice(func_get_args(), 1);

            return $listener->call($data);
        }

        if (!static::bound($event)) {
            return false;
        }

        if (isset(static::$events[$event])) {
            $events = static::$events[$event];
        } else {
            $events = static::$events['__bow.transmission.event'][$event];
        }

        $listeners = new Collection($events);

        $data = array_slice(func_get_args(), 1);

        $listeners->each(function (Listener $listener) use ($data) {

            if ($listener->getActionType() === 'string') {
                $callable = $listener->getAction();
            } else {
                $callable = [$listener, 'call'];
            }

            return Actionner::getInstance()->execute($callable, [$data]);
        });

        return true;
    }
946338
public function getEventClassName(string $event)
    {
        if (isset(self::$eventsMap[$event])) {
            return self::$eventsMap[$event];
        }

        $listeners = $this->eventDispatcher->getListeners($event);
        if (empty($listeners)) {
            return null;
        }

        foreach ($listeners as $listener) {
            if (!\is_array($listener) || 2 !== \count($listener)) {
                continue;
            }

            $reflectionMethod = new \ReflectionMethod($listener[0], $listener[1]);
            $args = $reflectionMethod->getParameters();
            if (!$args) {
                continue;
            }

            if (null !== $type = $args[0]->getType()) {
                return (string) $type;
            }
        }

        return null;
    }
614918
public function getEventCallbacks($event = null)
    {
        if ($event === null) {
            return $this->eventCallbacks;
        }

        return $this->eventCallbacks[strtolower($event)] ?? [];
    }
561067
protected function getValue($event)
    {
        if ($this->value === null) {
            $lock = $this->getLockAttribute();
            $input = Yii::getApp()->getRequest()->getParsedBodyParam($lock);
            $isValid = $input && (new NumberValidator())->validate($input);
            return $isValid ? $input : 0;
        }

        return parent::getValue($event);
    }
1139123
public function triggerEvent($event)
	{
		if (!($event instanceof EventInterface))
		{
			if (isset($this->events[$event]))
			{
				$event = $this->events[$event];
			}

			else
			{
				$event = new Event($event);
			}
		}

		if (isset($this->listeners[$event->getName()]))
		{
			foreach ($this->listeners[$event->getName()] as $listener)
			{
				if ($event->isStopped())
				{
					return $event;
				}

				if ($listener instanceof Closure)
				{
					call_user_func($listener, $event);
				}

				else
				{
					call_user_func(array($listener, $event->getName()), $event);
				}
			}
		}

		return $event;
	}
1180725
public function getArgs($event)
    {
        return [
            new DcCompat($event->getEnvironment(), $event->getModel()),
            $event->getModel()->getPropertiesAsArray(),
            $event->getEnvironment()->getDataDefinition()->getName(),
            $event->isCircularReference(),
            $event->getContainedModels(),
            $event->getPrevious() ? $event->getPrevious()->getId() : null,
            $event->getNext() ? $event->getNext()->getId() : null
        ];
    }
460029
public function dispatch(Event $event)
        {
            $message = sprintf(self::FMT_INF_DISPATCHING, $event->getId(), count($this->subscriptions));
            $this->logger->info($message);

            $dispatchCount = 0;

            foreach ($this->subscriptions as $subscription) {
                $result = $this->tryDispatch($subscription, $event);

                $dispatchCount += (int)$result;
            }

            $message = sprintf(self::FMT_INF_DISPATCHED, $event->getId(), $dispatchCount);
            $this->logger->info($message);

            return $dispatchCount;
        }
1196142
public function dispatch($event/*, string $eventName = null*/)
    {
        $eventName = 1 < \func_num_args() ? \func_get_arg(1) : null;

        if (\is_scalar($event)) {
            // deprecated
            $swap = $event;
            $event = $eventName ?? new Event();
            $eventName = $swap;
        }

        return $this->dispatcher->dispatch($event, $eventName);
    }
362284
public function getTriggerByEvent($event) {
        $data = [ ];
        $data['event'] = $event;

        $result = $this->apiGet('trigger', $data);
        return $result;
    }
845223
public function getEvent(string $event, ?string $table = null): ?callable
    {
        $table = $table ?? static::TABLE_ANY;

        if ($table instanceof Raw) {
            return null;
        }

        if (isset($this->events[$table][$event]) === true) {
            return $this->events[$table][$event];
        }

        // Find event with wildcard (*)
        if (isset($this->events[$table]) === true) {
            foreach ((array)$this->events[$table] as $name => $e) {
                if (strpos($name, '*') !== false) {
                    $name = substr($name, 0, strpos($name, '*'));
                    if (strpos($event, $name) !== false) {
                        return $e;
                    }
                }
            }
        }

        return null;
    }