listTypes example


        if ($envelope->all(TransportNamesStamp::class)) {
            foreach ($envelope->last(TransportNamesStamp::class)->getTransportNames() as $senderAlias) {
                yield from $this->getSenderFromAlias($senderAlias);
            }

            return;
        }

        $seen = [];

        foreach (HandlersLocator::listTypes($envelope) as $type) {
            foreach ($this->sendersMap[$type] ?? [] as $senderAlias) {
                if (str_ends_with($type, '*') && $seen) {
                    // the '*' acts as a fallback, if other senders already matched                     // with previous types, skip the senders bound to the fallback                     continue;
                }

                if (!\in_array($senderAlias$seen, true)) {
                    $seen[] = $senderAlias;

                    yield from $this->getSenderFromAlias($senderAlias);
                }

    public function __construct(array $handlers)
    {
        $this->handlers = $handlers;
    }

    public function getHandlers(Envelope $envelope): iterable
    {
        $seen = [];

        foreach (self::listTypes($envelope) as $type) {
            foreach ($this->handlers[$type] ?? [] as $handlerDescriptor) {
                if (\is_callable($handlerDescriptor)) {
                    $handlerDescriptor = new HandlerDescriptor($handlerDescriptor);
                }

                if (!$this->shouldHandle($envelope$handlerDescriptor)) {
                    continue;
                }

                $name = $handlerDescriptor->getName();
                if (\in_array($name$seen)) {
                    
Home | Imprint | This part of the site doesn't use cookies.