2023-01-05 15:33:20 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace DigiComp\FlowSymfonyBridge\Messenger\Transport;
|
|
|
|
|
|
|
|
use Neos\Flow\Annotations as Flow;
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
use Symfony\Component\Messenger\Transport\TransportInterface;
|
|
|
|
|
2023-02-18 22:53:05 +01:00
|
|
|
#[Flow\Scope('singleton')]
|
2023-01-05 15:33:20 +01:00
|
|
|
class FailureTransportContainer implements ContainerInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var TransportInterface[]
|
|
|
|
*/
|
|
|
|
protected array $transports;
|
|
|
|
|
|
|
|
public function get(string $id)
|
|
|
|
{
|
|
|
|
return $this->transports[$id];
|
|
|
|
}
|
|
|
|
|
2023-02-18 22:53:05 +01:00
|
|
|
public function has(string $id): bool
|
2023-01-05 15:33:20 +01:00
|
|
|
{
|
|
|
|
return isset($this->transports[$id]);
|
|
|
|
}
|
|
|
|
|
2023-02-18 22:53:05 +01:00
|
|
|
public function set(string $id, TransportInterface $transport): void
|
2023-01-05 15:33:20 +01:00
|
|
|
{
|
|
|
|
$this->transports[$id] = $transport;
|
|
|
|
}
|
|
|
|
}
|