Merge branch '4.3' into 4.4
* 4.3: ensure legacy event dispatcher compatibility
This commit is contained in:
commit
a0bbae7514
@ -14,6 +14,7 @@ namespace Symfony\Component\Mailer\Transport;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
use Symfony\Component\Mailer\Envelope;
|
use Symfony\Component\Mailer\Envelope;
|
||||||
|
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||||
use Symfony\Component\Mailer\Event\MessageEvent;
|
use Symfony\Component\Mailer\Event\MessageEvent;
|
||||||
use Symfony\Component\Mailer\SentMessage;
|
use Symfony\Component\Mailer\SentMessage;
|
||||||
use Symfony\Component\Mime\Address;
|
use Symfony\Component\Mime\Address;
|
||||||
@ -32,7 +33,7 @@ abstract class AbstractTransport implements TransportInterface
|
|||||||
|
|
||||||
public function __construct(EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
|
public function __construct(EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
|
||||||
{
|
{
|
||||||
$this->dispatcher = $dispatcher;
|
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
|
||||||
$this->logger = $logger ?: new NullLogger();
|
$this->logger = $logger ?: new NullLogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Messenger\Middleware;
|
|||||||
|
|
||||||
use Psr\Log\LoggerAwareTrait;
|
use Psr\Log\LoggerAwareTrait;
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
|
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||||
use Symfony\Component\Messenger\Envelope;
|
use Symfony\Component\Messenger\Envelope;
|
||||||
use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent;
|
use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent;
|
||||||
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
|
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
|
||||||
@ -36,7 +37,7 @@ class SendMessageMiddleware implements MiddlewareInterface
|
|||||||
public function __construct(SendersLocatorInterface $sendersLocator, EventDispatcherInterface $eventDispatcher = null)
|
public function __construct(SendersLocatorInterface $sendersLocator, EventDispatcherInterface $eventDispatcher = null)
|
||||||
{
|
{
|
||||||
$this->sendersLocator = $sendersLocator;
|
$this->sendersLocator = $sendersLocator;
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
|
||||||
$this->logger = new NullLogger();
|
$this->logger = new NullLogger();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Messenger;
|
|||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
|
use Symfony\Component\ErrorRenderer\Exception\FlattenException;
|
||||||
|
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
|
||||||
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
|
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
|
||||||
use Symfony\Component\Messenger\Event\WorkerMessageHandledEvent;
|
use Symfony\Component\Messenger\Event\WorkerMessageHandledEvent;
|
||||||
use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent;
|
use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent;
|
||||||
@ -49,7 +50,7 @@ class Worker implements WorkerInterface
|
|||||||
$this->receivers = $receivers;
|
$this->receivers = $receivers;
|
||||||
$this->bus = $bus;
|
$this->bus = $bus;
|
||||||
$this->retryStrategies = $retryStrategies;
|
$this->retryStrategies = $retryStrategies;
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = LegacyEventDispatcherProxy::decorate($eventDispatcher);
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user