DigiComp.FlowSymfonyBridge..../Classes/Transport/NullTransportFactory.php

27 lines
703 B
PHP
Raw Normal View History

<?php
namespace DigiComp\FlowSymfonyBridge\Messenger\Transport;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
class NullTransportFactory implements TransportFactoryInterface
{
/**
* @inheritDoc
*/
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
{
return new NullTransport();
}
/**
* @inheritDoc
*/
public function supports(string $dsn, array $options): bool
{
2022-09-18 13:17:53 +02:00
return 0 === \strpos($dsn, 'null://');
}
}