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

21 lines
636 B
PHP
Raw Permalink 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
{
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
{
return new NullTransport();
}
public function supports(string $dsn, array $options): bool
{
2023-02-18 22:53:05 +01:00
return \str_starts_with($dsn, 'null://');
}
}