Unverified Commit 3b8e4326 authored by alexpott's avatar alexpott
Browse files

Issue #3055198 by catch, longwave, mikelutz, alexpott: [Symfony 5]...

Issue #3055198 by catch, longwave, mikelutz, alexpott: [Symfony 5] Symfony/Component/EventDispatcher/Event is deprecated in Symfony 4.3 use Symfony/Contracts/EventDispatcher/Event instead
parent 702e8246
......@@ -2509,7 +2509,7 @@ function hook_validation_constraint_alter(array &$definitions) {
* you should normally define as a constant in a separate static class (see
* \Symfony\Component\HttpKernel\KernelEvents and
* \Drupal\Core\Config\ConfigEvents for examples). The second argument is a
* \Symfony\Component\EventDispatcher\Event object; normally you will need to
* \Drupal\Component\EventDispatcher\Event object; normally you will need to
* extend this class, so that your event class can provide data to the event
* subscribers.
*
......
<?php
namespace Drupal\Component\EventDispatcher;
use Symfony\Component\EventDispatcher\Event as SymfonyEvent;
/**
* Provides a forward-compatibility layer for the Symfony 5 event class.
*
* Symfony 5 relies on the Symfony\Contracts\EventDispatcher\Event class.
* In order to prepare for updates, code that wishes to extend Symfony's Event
* class should extend this intermediary class, which will handle switching
* from Symfony\Component to Symfony\Contracts without a further change.
*/
class Event extends SymfonyEvent {}
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Config;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Gets information on all the possible configuration collections.
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Config;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Wraps a configuration event for event listeners.
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Config;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
class ConfigImporterEvent extends Event {
/**
......
......@@ -4,7 +4,7 @@
use Drupal\Component\Utility\NestedArray;
use Drupal\Core\Language\LanguageInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Event object to allow configuration to be overridden by modules.
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Config\Importer;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Wraps a configuration event for event listeners.
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Config;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Class StorageTransformEvent.
......
......@@ -7,7 +7,6 @@
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\Menu\MenuLinkManagerInterface;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Core\Database\Connection;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -64,10 +63,10 @@ public function __construct(LockBackendInterface $lock, MenuLinkManagerInterface
/**
* Rebuilds the menu links and deletes the local_task cache tag.
*
* @param \Symfony\Component\EventDispatcher\Event $event
* @param \Drupal\Component\EventDispatcher\Event $event
* The event object.
*/
public function onRouterRebuild(Event $event) {
public function onRouterRebuild($event) {
$this->menuLinksRebuild();
Cache::invalidateTags(['local_task']);
}
......
......@@ -5,7 +5,7 @@
use Drupal\Core\Cache\RefinableCacheableDependencyInterface;
use Drupal\Core\Cache\RefinableCacheableDependencyTrait;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Event fired when rendering main content, to select a page display variant.
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Routing;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
use Symfony\Component\Routing\RouteCollection;
/**
......
......@@ -8,7 +8,7 @@
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Lock\LockBackendInterface;
use Drupal\Core\DestructableInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\Route;
......
......@@ -5,7 +5,6 @@
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\State\StateInterface;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\KernelEvent;
use Symfony\Component\HttpKernel\KernelEvents;
......@@ -108,11 +107,8 @@ public function onAlterRoutes(RouteBuildEvent $event) {
/**
* Store the non admin routes in state when the route building is finished.
*
* @param \Symfony\Component\EventDispatcher\Event $event
* The route finish event.
*/
public function onFinishedRoutes(Event $event) {
public function onFinishedRoutes() {
$this->state->set('routing.non_admin_routes', $this->nonAdminRoutesOnRebuild);
$this->nonAdminRoutesOnRebuild = [];
}
......
......@@ -48,11 +48,11 @@ final class RoutingEvents {
*
* This event gives modules the opportunity to perform some action after route
* building has completed. The event listener receives a
* \Symfony\Component\EventDispatcher\Event instance.
* \Drupal\Component\EventDispatcher\Event instance.
*
* @Event
*
* @see \Symfony\Component\EventDispatcher\Event
* @see \Drupal\Component\EventDispatcher\Event
* @see \Drupal\Core\EventSubscriber\MenuRouterRebuildSubscriber
* @see \Drupal\Core\Routing\RouteBuilder::rebuild()
*
......
......@@ -2,7 +2,7 @@
namespace Drupal\Core\Session;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Event fired when an account is set for the current session.
......
......@@ -4,7 +4,7 @@
use Drupal\block_content\BlockContentInterface;
use Drupal\Core\Access\AccessibleInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Block content event to allow setting an access dependency.
......
......@@ -4,7 +4,7 @@
use Drupal\config_translation\ConfigMapperInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Provides a class for events related to configuration translation mappers.
......
......@@ -4,7 +4,7 @@
use Drupal\Component\Assertion\Inspector;
use Drupal\Core\Entity\EntityTypeInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* An event used to configure the construction of a JSON:API resource type.
......
......@@ -2,7 +2,7 @@
namespace Drupal\language\Config;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Provides a language override event for event listeners.
......
......@@ -4,7 +4,7 @@
use Drupal\Core\Cache\CacheableResponseTrait;
use Drupal\layout_builder\SectionComponent;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
/**
* Event fired when a section component's render array is being built.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment