Skip to content
Snippets Groups Projects
Commit 754299f6 authored by Luhur Abdi Rizal's avatar Luhur Abdi Rizal
Browse files

Issue #3263299 by el7cosmos: Move events constant from interface to a class

parent 68ceb417
No related branches found
Tags 3.1.0
No related merge requests found
Showing
with 251 additions and 52 deletions
......@@ -5,6 +5,7 @@ namespace Drupal\hook_event_dispatcher;
use Drupal\core_event_dispatcher\Event\Form\FormAlterEvent;
use Drupal\core_event_dispatcher\Event\Form\FormBaseAlterEvent;
use Drupal\core_event_dispatcher\Event\Form\FormIdAlterEvent;
use Drupal\core_event_dispatcher\FormHookEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
......@@ -63,7 +64,7 @@ class ExampleFormEventSubscribers implements EventSubscriberInterface {
*/
public static function getSubscribedEvents(): array {
return [
HookEventDispatcherInterface::FORM_ALTER => 'alterForm',
FormHookEvents::FORM_ALTER => 'alterForm',
// React on "search_block_form" form.
'hook_event_dispatcher.form_search_block_form.alter' => 'alterSearchForm',
// React on al forms with base id "node_form".
......
......@@ -5,6 +5,7 @@ namespace Drupal\hook_event_dispatcher;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\core_event_dispatcher\Event\Token\TokensInfoEvent;
use Drupal\core_event_dispatcher\Event\Token\TokensReplacementEvent;
use Drupal\core_event_dispatcher\TokenHookEvents;
use Drupal\core_event_dispatcher\ValueObject\Token;
use Drupal\core_event_dispatcher\ValueObject\TokenType;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
......@@ -28,8 +29,8 @@ final class ExampleTokenEventSubscriber implements EventSubscriberInterface {
*/
public static function getSubscribedEvents(): array {
return [
HookEventDispatcherInterface::TOKEN_REPLACEMENT => 'tokenReplacement',
HookEventDispatcherInterface::TOKEN_INFO => 'tokenInfo',
TokenHookEvents::TOKEN_REPLACEMENT => 'tokenReplacement',
TokenHookEvents::TOKEN_INFO => 'tokenInfo',
];
}
......
......@@ -2,7 +2,7 @@
namespace Drupal\core_event_dispatcher\Event\Form;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\core_event_dispatcher\FormHookEvents;
/**
* Class FormAlterEvent.
......@@ -13,7 +13,7 @@ class FormAlterEvent extends AbstractFormEvent {
* {@inheritdoc}
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::FORM_ALTER;
return FormHookEvents::FORM_ALTER;
}
}
......@@ -2,10 +2,10 @@
namespace Drupal\core_event_dispatcher\Event\Language;
use Drupal\Component\EventDispatcher\Event;
use Drupal\Core\Url;
use Drupal\core_event_dispatcher\LanguageHookEvents;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\Component\EventDispatcher\Event;
/**
* Class LanguageSwitchLinksAlterEvent.
......@@ -18,12 +18,14 @@ class LanguageSwitchLinksAlterEvent extends Event implements EventInterface {
* @var array
*/
private $links;
/**
* The language type.
*
* @var string
*/
private $type;
/**
* The request path.
*
......@@ -93,7 +95,7 @@ class LanguageSwitchLinksAlterEvent extends Event implements EventInterface {
* {@inheritdoc}
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::LANGUAGE_SWITCH_LINKS_ALTER;
return LanguageHookEvents::LANGUAGE_SWITCH_LINKS_ALTER;
}
}
......@@ -2,9 +2,9 @@
namespace Drupal\core_event_dispatcher\Event\Theme;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\Component\EventDispatcher\Event;
use Drupal\core_event_dispatcher\PageHookEvents;
use Drupal\hook_event_dispatcher\Event\EventInterface;
/**
* Class PageAttachmentsEvent.
......@@ -42,7 +42,7 @@ class PageAttachmentsEvent extends Event implements EventInterface {
* {@inheritdoc}
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::PAGE_ATTACHMENTS;
return PageHookEvents::PAGE_ATTACHMENTS;
}
}
......@@ -2,9 +2,9 @@
namespace Drupal\core_event_dispatcher\Event\Theme;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\Component\EventDispatcher\Event;
use Drupal\core_event_dispatcher\PageHookEvents;
use Drupal\hook_event_dispatcher\Event\EventInterface;
/**
* Class PageBottomEvent.
......@@ -42,7 +42,7 @@ class PageBottomEvent extends Event implements EventInterface {
* {@inheritdoc}
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::PAGE_BOTTOM;
return PageHookEvents::PAGE_BOTTOM;
}
}
......@@ -2,9 +2,9 @@
namespace Drupal\core_event_dispatcher\Event\Theme;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\Component\EventDispatcher\Event;
use Drupal\core_event_dispatcher\PageHookEvents;
use Drupal\hook_event_dispatcher\Event\EventInterface;
/**
* Class PageTopEvent.
......@@ -42,7 +42,7 @@ class PageTopEvent extends Event implements EventInterface {
* {@inheritdoc}
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::PAGE_TOP;
return PageHookEvents::PAGE_TOP;
}
}
......@@ -2,11 +2,11 @@
namespace Drupal\core_event_dispatcher\Event\Token;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\Component\EventDispatcher\Event;
use Drupal\core_event_dispatcher\TokenHookEvents;
use Drupal\core_event_dispatcher\ValueObject\Token;
use Drupal\core_event_dispatcher\ValueObject\TokenType;
use Drupal\Component\EventDispatcher\Event;
use Drupal\hook_event_dispatcher\Event\EventInterface;
/**
* Class TokensInfoEvent.
......@@ -21,6 +21,7 @@ final class TokensInfoEvent extends Event implements EventInterface {
* @var array
*/
private $tokenTypes = [];
/**
* Tokens.
*
......@@ -111,7 +112,7 @@ final class TokensInfoEvent extends Event implements EventInterface {
* The dispatcher type.
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::TOKEN_INFO;
return TokenHookEvents::TOKEN_INFO;
}
}
......@@ -2,11 +2,11 @@
namespace Drupal\core_event_dispatcher\Event\Token;
use Drupal\Component\EventDispatcher\Event;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\core_event_dispatcher\TokenHookEvents;
use Drupal\hook_event_dispatcher\Event\EventInterface;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\Component\EventDispatcher\Event;
use UnexpectedValueException;
use function is_string;
......@@ -28,30 +28,35 @@ final class TokensReplacementEvent extends Event implements EventInterface {
* @var string[]|\Drupal\Component\Render\MarkupInterface[]
*/
private $replacementValues = [];
/**
* Type.
*
* @var string
*/
private $type;
/**
* Tokens.
*
* @var array
*/
private $tokens;
/**
* Data.
*
* @var array
*/
private $data;
/**
* Options.
*
* @var array
*/
private $options;
/**
* Bubbleable meta data.
*
......@@ -229,7 +234,7 @@ final class TokensReplacementEvent extends Event implements EventInterface {
* {@inheritdoc}
*/
public function getDispatcherType(): string {
return HookEventDispatcherInterface::TOKEN_REPLACEMENT;
return TokenHookEvents::TOKEN_REPLACEMENT;
}
/**
......
<?php
namespace Drupal\core_event_dispatcher;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
/**
* Defines events for form hooks.
*/
final class FormHookEvents {
/**
* Perform alterations before a form is rendered.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Form\FormAlterEvent
* @see core_event_dispatcher_form_alter()
* @see hook_form_alter()
*
* @var string
*/
public const FORM_ALTER = HookEventDispatcherInterface::PREFIX . 'form.alter';
}
<?php
namespace Drupal\core_event_dispatcher;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
/**
* Defines events for language hooks.
*/
final class LanguageHookEvents {
/**
* Alter the links generated to switch languages.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Language\LanguageSwitchLinksAlterEvent
* @see core_event_dispatcher_language_switch_links_alter()
* @see hook_language_switch_links_alter()
*
* @var string
*/
public const LANGUAGE_SWITCH_LINKS_ALTER = HookEventDispatcherInterface::PREFIX . 'language.switch_links_alter';
}
<?php
namespace Drupal\core_event_dispatcher;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
/**
* Defines events for page hooks.
*/
final class PageHookEvents {
/**
* Add a renderable array to the top of the page.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Theme\PageTopEvent
* @see core_event_dispatcher_page_top()
* @see hook_page_top()
*
* @var string
*/
public const PAGE_TOP = HookEventDispatcherInterface::PREFIX . 'page.top';
/**
* Add a renderable array to the bottom of the page.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Theme\PageBottomEvent
* @see core_event_dispatcher_page_bottom()
* @see hook_page_bottom()
*
* @var string
*/
public const PAGE_BOTTOM = HookEventDispatcherInterface::PREFIX . 'page.bottom';
/**
* Add attachments (typically assets) to a page before it is rendered.
*
* Attachments should be added to individual element render arrays whenever
* possible, as per Drupal best practices, so only use this when that isn't
* practical or you need to target the page itself.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Theme\PageAttachmentsEvent
* @see core_event_dispatcher_page_attachments()
* @see hook_page_attachments()
*
* @var string
*/
public const PAGE_ATTACHMENTS = HookEventDispatcherInterface::PREFIX . 'page.attachments';
}
<?php
namespace Drupal\core_event_dispatcher;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
/**
* Defines events for token hooks.
*/
final class TokenHookEvents {
/**
* Provide replacement values for placeholder tokens.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Token\TokensReplacementEvent
* @see core_event_dispatcher_tokens()
* @see hook_tokens()
*
* @var string
*/
public const TOKEN_REPLACEMENT = HookEventDispatcherInterface::PREFIX . 'token.replacement';
/**
* Provide information about available placeholder tokens and token types.
*
* @Event
*
* @see \Drupal\core_event_dispatcher\Event\Token\TokensInfoEvent
* @see core_event_dispatcher_token_info()
* @see hook_token_info()
*
* @var string
*/
public const TOKEN_INFO = HookEventDispatcherInterface::PREFIX . 'token.info';
}
......@@ -4,7 +4,7 @@ namespace Drupal\Tests\core_event_dispatcher\Kernel\Form;
use Drupal\Core\Form\FormState;
use Drupal\core_event_dispatcher\Event\Form\AbstractFormEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\core_event_dispatcher\FormHookEvents;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\hook_event_dispatcher\Kernel\ListenerTrait;
......@@ -35,7 +35,7 @@ class FormEventTest extends KernelTestBase {
*/
public function testFormAlterEvent(): void {
$this->listen([
HookEventDispatcherInterface::FORM_ALTER,
FormHookEvents::FORM_ALTER,
'hook_event_dispatcher.form_test_form.alter',
'hook_event_dispatcher.form_base_test_base_form.alter',
], 'onFormAlter', $this->exactly(3));
......@@ -58,7 +58,7 @@ class FormEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Form\AbstractFormEvent $event
* The event.
*/
public function onFormAlter(AbstractFormEvent $event) {
public function onFormAlter(AbstractFormEvent $event): void {
$form = &$event->getForm();
$form['test'] = 'test_altered';
......
......@@ -5,7 +5,7 @@ namespace Drupal\Tests\core_event_dispatcher\Kernel\Language;
use Drupal\Core\Language\LanguageInterface;
use Drupal\Core\Url;
use Drupal\core_event_dispatcher\Event\Language\LanguageSwitchLinksAlterEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\core_event_dispatcher\LanguageHookEvents;
use Drupal\KernelTests\KernelTestBase;
use Drupal\language\ConfigurableLanguageManager;
use Drupal\Tests\hook_event_dispatcher\Kernel\ListenerTrait;
......@@ -37,7 +37,7 @@ class LanguageSwitchLinksAlterEventTest extends KernelTestBase {
* @throws \Exception
*/
public function testLanguageSwitchLinksAlter(): void {
$this->listen(HookEventDispatcherInterface::LANGUAGE_SWITCH_LINKS_ALTER, 'onLanguageSwitchLinksAlter');
$this->listen(LanguageHookEvents::LANGUAGE_SWITCH_LINKS_ALTER, 'onLanguageSwitchLinksAlter');
$this->config('language.types')->set('negotiation.' . LanguageInterface::TYPE_URL . '.enabled', [
'language-url' => TRUE,
......@@ -64,7 +64,7 @@ class LanguageSwitchLinksAlterEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Language\LanguageSwitchLinksAlterEvent $event
* The event.
*/
public function onLanguageSwitchLinksAlter(LanguageSwitchLinksAlterEvent $event) {
public function onLanguageSwitchLinksAlter(LanguageSwitchLinksAlterEvent $event): void {
$this->assertEquals(LanguageInterface::TYPE_URL, $event->getType());
$this->assertEquals('<current>', $event->getPath()->getRouteName());
......
......@@ -5,7 +5,7 @@ namespace Drupal\Tests\core_event_dispatcher\Kernel\Theme;
use Drupal\core_event_dispatcher\Event\Theme\PageAttachmentsEvent;
use Drupal\core_event_dispatcher\Event\Theme\PageBottomEvent;
use Drupal\core_event_dispatcher\Event\Theme\PageTopEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\core_event_dispatcher\PageHookEvents;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\hook_event_dispatcher\Kernel\ListenerTrait;
......@@ -37,9 +37,9 @@ class PageEventTest extends KernelTestBase {
* @throws \Exception
*/
public function testPageEvents(): void {
$this->listen(HookEventDispatcherInterface::PAGE_ATTACHMENTS, 'onPageAttachments');
$this->listen(HookEventDispatcherInterface::PAGE_TOP, 'onPageTop');
$this->listen(HookEventDispatcherInterface::PAGE_BOTTOM, 'onPageBottom');
$this->listen(PageHookEvents::PAGE_ATTACHMENTS, 'onPageAttachments');
$this->listen(PageHookEvents::PAGE_TOP, 'onPageTop');
$this->listen(PageHookEvents::PAGE_BOTTOM, 'onPageBottom');
$response = $this->container->get('main_content_renderer.html')->renderResponse(
[],
......@@ -61,7 +61,7 @@ class PageEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Theme\PageAttachmentsEvent $event
* The event.
*/
public function onPageAttachments(PageAttachmentsEvent $event) {
public function onPageAttachments(PageAttachmentsEvent $event): void {
$attachments = &$event->getAttachments();
$attachments['#attached']['library'][] = 'test/test';
}
......@@ -72,7 +72,7 @@ class PageEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Theme\PageTopEvent $event
* The event.
*/
public function onPageTop(PageTopEvent $event) {
public function onPageTop(PageTopEvent $event): void {
$build = &$event->getBuild();
$build['new'] = ['#markup' => 'Top!'];
}
......@@ -83,7 +83,7 @@ class PageEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Theme\PageBottomEvent $event
* The event.
*/
public function onPageBottom(PageBottomEvent $event) {
public function onPageBottom(PageBottomEvent $event): void {
$build = &$event->getBuild();
$build['new'] = ['#markup' => 'Bottom!'];
}
......
......@@ -3,9 +3,9 @@
namespace Drupal\Tests\core_event_dispatcher\Kernel\Token;
use Drupal\core_event_dispatcher\Event\Token\TokensInfoEvent;
use Drupal\core_event_dispatcher\TokenHookEvents;
use Drupal\core_event_dispatcher\ValueObject\Token;
use Drupal\core_event_dispatcher\ValueObject\TokenType;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\hook_event_dispatcher\Kernel\ListenerTrait;
......@@ -35,7 +35,7 @@ class TokenInfoEventTest extends KernelTestBase {
* @throws \Exception
*/
public function testTokenInfoEvent(): void {
$this->listen(HookEventDispatcherInterface::TOKEN_INFO, 'onTokenInfo');
$this->listen(TokenHookEvents::TOKEN_INFO, 'onTokenInfo');
$expectedTypes = [
'test_type' => [
......@@ -89,7 +89,7 @@ class TokenInfoEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Token\TokensInfoEvent $event
* The event.
*/
public function onTokenInfo(TokensInfoEvent $event) {
public function onTokenInfo(TokensInfoEvent $event): void {
$types = [
TokenType::create('test_type', 'Test type')->setDescription('Test type desc'),
TokenType::create('other_type', 'Other type')->setDescription('Other type!')->setNeedsData('test_data'),
......
......@@ -4,7 +4,7 @@ namespace Drupal\Tests\core_event_dispatcher\Kernel\Token;
use Drupal\Core\Render\BubbleableMetadata;
use Drupal\core_event_dispatcher\Event\Token\TokensReplacementEvent;
use Drupal\hook_event_dispatcher\HookEventDispatcherInterface;
use Drupal\core_event_dispatcher\TokenHookEvents;
use Drupal\KernelTests\KernelTestBase;
use Drupal\Tests\hook_event_dispatcher\Kernel\ListenerTrait;
......@@ -77,7 +77,7 @@ class TokenReplacementEventTest extends KernelTestBase {
* @throws \Exception
*/
public function testTokenReplacementEvent(): void {
$this->listen(HookEventDispatcherInterface::TOKEN_REPLACEMENT, 'onTokenReplacement');
$this->listen(TokenHookEvents::TOKEN_REPLACEMENT, 'onTokenReplacement');
$expectedReplacements = [
'[test_type:token1]' => 'Replacement value 1',
......@@ -94,7 +94,7 @@ class TokenReplacementEventTest extends KernelTestBase {
* @param \Drupal\core_event_dispatcher\Event\Token\TokensReplacementEvent $event
* The event.
*/
public function onTokenReplacement(TokensReplacementEvent $event) {
public function onTokenReplacement(TokensReplacementEvent $event): void {
$this->assertEquals(self::TYPE, $event->getType());
$this->assertEquals(self::TOKENS, $event->getTokens());
$this->assertEquals(self::DATA, $event->getRawData());
......@@ -112,7 +112,7 @@ class TokenReplacementEventTest extends KernelTestBase {
public function testTokenReplacementEventWrongReplacementException(): void {
$this->expectException(\UnexpectedValueException::class);
$this->eventDispatcher->addListener(HookEventDispatcherInterface::TOKEN_REPLACEMENT, function (TokensReplacementEvent $event) {
$this->eventDispatcher->addListener(TokenHookEvents::TOKEN_REPLACEMENT, function (TokensReplacementEvent $event) {
$event->setReplacementValue('', '', '');
});
......@@ -125,7 +125,7 @@ class TokenReplacementEventTest extends KernelTestBase {
public function testTokenReplacementEventInvalidReplacementException(): void {
$this->expectException(\UnexpectedValueException::class);
$this->eventDispatcher->addListener(HookEventDispatcherInterface::TOKEN_REPLACEMENT, function (TokensReplacementEvent $event) {
$this->eventDispatcher->addListener(TokenHookEvents::TOKEN_REPLACEMENT, function (TokensReplacementEvent $event) {
$event->setReplacementValue('test', 'token', NULL);
});
......
......@@ -6,7 +6,11 @@ use Drupal\core_event_dispatcher\BlockHookEvents;
use Drupal\core_event_dispatcher\CoreHookEvents;
use Drupal\core_event_dispatcher\EntityHookEvents;
use Drupal\core_event_dispatcher\FileHookEvents;
use Drupal\core_event_dispatcher\FormHookEvents;
use Drupal\core_event_dispatcher\LanguageHookEvents;
use Drupal\core_event_dispatcher\PageHookEvents;
use Drupal\core_event_dispatcher\ThemeHookEvents;
use Drupal\core_event_dispatcher\TokenHookEvents;
use Drupal\field_event_dispatcher\FieldHookEvents;
use Drupal\jsonapi_event_dispatcher\JsonApiHookEvents;
use Drupal\media_event_dispatcher\MediaHookEvents;
......@@ -759,12 +763,18 @@ interface HookEventDispatcherInterface {
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\FormHookEvents::FORM_ALTER instead.
*
* @see https://www.drupal.org/node/3263301
* @see \Drupal\core_event_dispatcher\Event\Form\FormAlterEvent
* @see core_event_dispatcher_form_alter()
* @see hook_form_alter()
*
* @var string
*/
public const FORM_ALTER = self::PREFIX . 'form.alter';
public const FORM_ALTER = FormHookEvents::FORM_ALTER;
// BLOCK EVENTS.
/**
......@@ -845,24 +855,36 @@ interface HookEventDispatcherInterface {
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\TokenHookEvents::TOKEN_REPLACEMENT instead.
*
* @see https://www.drupal.org/node/3263301
* @see \Drupal\core_event_dispatcher\Event\Token\TokensReplacementEvent
* @see core_event_dispatcher_tokens()
* @see hook_tokens()
*
* @var string
*/
public const TOKEN_REPLACEMENT = self::PREFIX . 'token.replacement';
public const TOKEN_REPLACEMENT = TokenHookEvents::TOKEN_REPLACEMENT;
/**
* Provide information about available placeholder tokens and token types.
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\TokenHookEvents::TOKEN_INFO instead.
*
* @see https://www.drupal.org/node/3263301
* @see \Drupal\core_event_dispatcher\Event\Token\TokensInfoEvent
* @see core_event_dispatcher_token_info()
* @see hook_token_info()
*
* @var string
*/
public const TOKEN_INFO = self::PREFIX . 'token.info';
public const TOKEN_INFO = TokenHookEvents::TOKEN_INFO;
// PATH EVENTS.
/**
......@@ -1386,24 +1408,35 @@ interface HookEventDispatcherInterface {
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\PageHookEvents::PAGE_TOP instead.
*
* @see https://www.drupal.org/node/3263301
* @see \Drupal\core_event_dispatcher\Event\Theme\PageTopEvent
* @see core_event_dispatcher_page_top()
* @see hook_page_top()
*
* @var string
*/
public const PAGE_TOP = self::PREFIX . 'page.top';
public const PAGE_TOP = PageHookEvents::PAGE_TOP;
/**
* Add a renderable array to the bottom of the page.
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\PageHookEvents::PAGE_BOTTOM instead.
*
* @see https://www.drupal.org/node/3263301
* @see core_event_dispatcher_page_bottom()
* @see hook_page_bottom()
*
* @var string
*/
public const PAGE_BOTTOM = self::PREFIX . 'page.bottom';
public const PAGE_BOTTOM = PageHookEvents::PAGE_BOTTOM;
/**
* Add attachments (typically assets) to a page before it is rendered.
......@@ -1414,12 +1447,18 @@ interface HookEventDispatcherInterface {
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\PageHookEvents::PAGE_ATTACHMENTS instead.
*
* @see https://www.drupal.org/node/3263301
* @see \Drupal\core_event_dispatcher\Event\Theme\PageAttachmentsEvent
* @see core_event_dispatcher_page_attachments()
* @see hook_page_attachments()
*
* @var string
*/
public const PAGE_ATTACHMENTS = self::PREFIX . 'page.attachments';
public const PAGE_ATTACHMENTS = PageHookEvents::PAGE_ATTACHMENTS;
// CORE EVENTS.
/**
......@@ -1668,12 +1707,19 @@ interface HookEventDispatcherInterface {
*
* @Event
*
* @deprecated in hook_event_dispatcher:3.1.0 and is removed from
* hook_event_dispatcher:4.0.0. Use
* \Drupal\core_event_dispatcher\LanguageHookEvents::LANGUAGE_SWITCH_LINKS_ALTER
* instead.
*
* @see https://www.drupal.org/node/3263301
* @see \Drupal\core_event_dispatcher\Event\Language\LanguageSwitchLinksAlterEvent
* @see core_event_dispatcher_language_switch_links_alter()
* @see hook_language_switch_links_alter()
*
* @var string
*/
public const LANGUAGE_SWITCH_LINKS_ALTER = self::PREFIX . 'language.switch_links_alter';
public const LANGUAGE_SWITCH_LINKS_ALTER = LanguageHookEvents::LANGUAGE_SWITCH_LINKS_ALTER;
// WEBFORM EVENTS.
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment