HandlersLocatorFactory
not part of TYPO3 Core API
Table of Contents
Methods
- __construct() : mixed
- addHandler() : void
- internally called by the messageHandlerPass
- createHandlersLocator() : HandlersLocator
- normalizeTransports() : array<int, string>
- Normalizes a from_transport definition (null, a single transport name or a list of transport names) to a de-duplicated list of non-empty transport names. Shared with MessageHandlerPass so the compile-time handler identifier and the runtime handler descriptors agree on the resolved transports.
Methods
__construct()
public
__construct(ContainerInterface $container) : mixed
Parameters
- $container : ContainerInterface
addHandler()
internally called by the messageHandlerPass
public
addHandler(string $messageClass, string $handlerService, string $handlerMethod[, string|array<int, string>|null $fromTransport = null ]) : void
$fromTransport binds the handler to one or more receiving transports: the handler is then only executed for messages received from one of those transports (matched against the envelope's ReceivedStamp by Symfony's HandlersLocator). A null value (the default) - or an empty list - keeps the handler bound to all transports.
Symfony's HandlersLocator only compares a scalar from_transport option against the received transport, so a list is registered as one handler descriptor per transport. Only the descriptor matching the received transport passes, and Symfony's per-name de-duplication ensures the handler still runs at most once per message.
Parameters
- $messageClass : string
- $handlerService : string
- $handlerMethod : string
- $fromTransport : string|array<int, string>|null = null
createHandlersLocator()
public
createHandlersLocator() : HandlersLocator
Return values
HandlersLocatornormalizeTransports()
Normalizes a from_transport definition (null, a single transport name or a list of transport names) to a de-duplicated list of non-empty transport names. Shared with MessageHandlerPass so the compile-time handler identifier and the runtime handler descriptors agree on the resolved transports.
public
static normalizeTransports(string|array<int, string>|null $fromTransport) : array<int, string>
Parameters
- $fromTransport : string|array<int, string>|null