Skip to content

[EventDispatcher] Remove LegacyEventDispatcherProxy #41304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Symfony/Component/EventDispatcher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

6.0
---

* Remove `LegacyEventDispatcherProxy`

5.3
---

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/Symfony/Component/EventDispatcher/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
],
"require": {
"php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.1",
"symfony/event-dispatcher-contracts": "^2"
},
"require-dev": {
Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Component/Mailer/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Component\Mailer;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Component\Mailer\Messenger\SendEmailMessage;
use Symfony\Component\Mailer\Transport\TransportInterface;
Expand All @@ -33,7 +31,7 @@ public function __construct(TransportInterface $transport, MessageBusInterface $
{
$this->transport = $transport;
$this->bus = $bus;
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
}

public function send(RawMessage $message, Envelope $envelope = null): void
Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Component/Mailer/Transport/AbstractTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Mailer\Envelope;
use Symfony\Component\Mailer\Event\MessageEvent;
use Symfony\Component\Mailer\SentMessage;
Expand All @@ -34,7 +32,7 @@ abstract class AbstractTransport implements TransportInterface

public function __construct(EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
$this->logger = $logger ?? new NullLogger();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

use Psr\Log\LoggerAwareTrait;
use Psr\Log\NullLogger;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent;
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
Expand All @@ -36,7 +34,7 @@ class SendMessageMiddleware implements MiddlewareInterface
public function __construct(SendersLocatorInterface $sendersLocator, EventDispatcherInterface $eventDispatcher = null)
{
$this->sendersLocator = $sendersLocator;
$this->eventDispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($eventDispatcher) : $eventDispatcher;
$this->eventDispatcher = $eventDispatcher;
$this->logger = new NullLogger();
}

Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Component/Messenger/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
namespace Symfony\Component\Messenger;

use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
use Symfony\Component\Messenger\Event\WorkerMessageHandledEvent;
use Symfony\Component\Messenger\Event\WorkerMessageReceivedEvent;
Expand Down Expand Up @@ -51,7 +49,7 @@ public function __construct(array $receivers, MessageBusInterface $bus, EventDis
$this->receivers = $receivers;
$this->bus = $bus;
$this->logger = $logger;
$this->eventDispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($eventDispatcher) : $eventDispatcher;
$this->eventDispatcher = $eventDispatcher;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Component/Notifier/Chatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Component\Notifier;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Notifier\Event\MessageEvent;
use Symfony\Component\Notifier\Message\MessageInterface;
Expand All @@ -33,7 +31,7 @@ public function __construct(TransportInterface $transport, MessageBusInterface $
{
$this->transport = $transport;
$this->bus = $bus;
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
}

public function __toString(): string
Expand Down
4 changes: 1 addition & 3 deletions src/Symfony/Component/Notifier/Texter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Component\Notifier;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Notifier\Event\MessageEvent;
use Symfony\Component\Notifier\Message\MessageInterface;
Expand All @@ -33,7 +31,7 @@ public function __construct(TransportInterface $transport, MessageBusInterface $
{
$this->transport = $transport;
$this->bus = $bus;
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
}

public function __toString(): string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Component\Notifier\Transport;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\Notifier\Event\MessageEvent;
use Symfony\Component\Notifier\Exception\LogicException;
Expand Down Expand Up @@ -45,7 +43,7 @@ public function __construct(HttpClientInterface $client = null, EventDispatcherI
$this->client = HttpClient::create();
}

$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Component\Notifier\Transport;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Notifier\Exception\IncompleteDsnException;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
Expand All @@ -28,7 +26,7 @@ abstract class AbstractTransportFactory implements TransportFactoryInterface

public function __construct(EventDispatcherInterface $dispatcher = null, HttpClientInterface $client = null)
{
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
$this->client = $client;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace Symfony\Component\Notifier\Transport;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\Notifier\Event\MessageEvent;
use Symfony\Component\Notifier\Message\MessageInterface;
use Symfony\Component\Notifier\Message\NullMessage;
Expand All @@ -28,7 +26,7 @@ class NullTransport implements TransportInterface

public function __construct(EventDispatcherInterface $dispatcher = null)
{
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;
}

public function send(MessageInterface $message): SentMessage
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Notifier/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"symfony/http-kernel": "<5.4",
"symfony/discord-notifier": "<5.4",
"symfony/esendex-notifier": "<5.4",
"symfony/event-dispatcher": "<5.4",
"symfony/firebase-notifier": "<5.4",
"symfony/free-mobile-notifier": "<5.4",
"symfony/google-chat-notifier": "<5.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
namespace Symfony\Component\Security\Http\Firewall;

use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpKernel\Event\RequestEvent;
Expand Down Expand Up @@ -68,7 +66,7 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP
$this->userProviders = $userProviders;
$this->sessionKey = '_security_'.$contextKey;
$this->logger = $logger;
$this->dispatcher = class_exists(Event::class) ? LegacyEventDispatcherProxy::decorate($dispatcher) : $dispatcher;
$this->dispatcher = $dispatcher;

$this->trustResolver = $trustResolver ?? new AuthenticationTrustResolver(AnonymousToken::class, RememberMeToken::class);
$this->sessionTrackerEnabler = $sessionTrackerEnabler;
Expand Down