Initial commit: CloudOps infrastructure platform
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\MessengerBundle\Transport;
|
||||
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
use Symfony\Component\Messenger\Transport\TransportInterface;
|
||||
|
||||
class NullTransport implements TransportInterface
|
||||
{
|
||||
public function get(): iterable
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function ack(Envelope $envelope): void
|
||||
{
|
||||
}
|
||||
|
||||
public function reject(Envelope $envelope): void
|
||||
{
|
||||
}
|
||||
|
||||
public function send(Envelope $envelope): Envelope
|
||||
{
|
||||
return $envelope;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mautic\MessengerBundle\Transport;
|
||||
|
||||
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
||||
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
|
||||
use Symfony\Component\Messenger\Transport\TransportInterface;
|
||||
|
||||
/**
|
||||
* Needed for the E2E tests.
|
||||
*/
|
||||
class NullTransportFactory implements TransportFactoryInterface
|
||||
{
|
||||
/**
|
||||
* @param mixed[] $options
|
||||
*/
|
||||
public function createTransport(string $dsn, array $options, SerializerInterface $serializer): TransportInterface
|
||||
{
|
||||
return new NullTransport();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed[] $options
|
||||
*/
|
||||
public function supports(string $dsn, array $options): bool
|
||||
{
|
||||
return str_starts_with($dsn, 'null://');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user