Skip to content
Snippets Groups Projects
Commit 8b9698ed authored by Eric Bremner's avatar Eric Bremner
Browse files

Updating code to use hook_event_dispatcher 2.x branch

parent 4cc27be1
No related branches found
Tags 2.0.0-rc1
No related merge requests found
......@@ -4,4 +4,4 @@ type: module
core_version_requirement: ^8.8 || ^9
dependencies:
- drupal:layout_builder
- hook_event_dispatcher
- hook_event_dispatcher:core_event_dispatcher
......@@ -3,7 +3,9 @@
namespace Drupal\layout_builder_ids\EventSubscriber;
use Drupal\Core\Form\FormStateInterface;
use Drupal\hook_event_dispatcher\Event\Form\FormAlterEvent;
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\hook_event_dispatcher\HookEventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Drupal\Component\Utility\Html;
......@@ -16,10 +18,10 @@ class LayoutBuilderIdsConfigureBlock implements EventSubscriberInterface {
/**
* Alter form.
*
* @param \Drupal\hook_event_dispatcher\Event\Form\FormAlterEvent $event
* @param \Drupal\core_event_dispatcher\Event\Form\FormAlterEvent $event
* The event.
*/
public function alterForm(FormAlterEvent $event) {
public function alterForm(FormAlterEvent $event): void {
// Get the form from the event.
$form = &$event->getForm();
......@@ -67,7 +69,8 @@ class LayoutBuilderIdsConfigureBlock implements EventSubscriberInterface {
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
public static function getSubscribedEvents(): array {
return [
HookEventDispatcherInterface::FORM_ALTER => 'alterForm',
];
......
......@@ -3,10 +3,11 @@
namespace Drupal\layout_builder_ids\EventSubscriber;
use Drupal\Core\Form\FormStateInterface;
use Drupal\hook_event_dispatcher\Event\Form\FormAlterEvent;
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\hook_event_dispatcher\HookEventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\RouteCollection;
use Drupal\Component\Utility\Html;
......@@ -18,10 +19,10 @@ class LayoutBuilderIdsConfigureSection implements EventSubscriberInterface {
/**
* Alter form.
*
* @param \Drupal\hook_event_dispatcher\Event\Form\FormAlterEvent $event
* @param \Drupal\core_event_dispatcher\Event\Form\FormAlterEvent $event
* The event.
*/
public function alterForm(FormAlterEvent $event) {
public function alterForm(FormAlterEvent $event): void {
// Get the form from the event.
$form = &$event->getForm();
......
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