From ffebaf1f87b0b647b720b2719d06e5f62ba81308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Andr=C3=A9?= Date: Thu, 7 Nov 2024 12:42:05 +0100 Subject: [PATCH] dfdf --- src/TwigComponent/src/BlockStack.php | 4 ++-- .../src/EventDispatcher/ComponentEventDispatcher.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/TwigComponent/src/BlockStack.php b/src/TwigComponent/src/BlockStack.php index 92aedd4a7d2..3175c86cdbe 100644 --- a/src/TwigComponent/src/BlockStack.php +++ b/src/TwigComponent/src/BlockStack.php @@ -26,7 +26,7 @@ final class BlockStack /** * @var array>> */ - private static array $stack = []; + private array $stack = []; /** * @var array @@ -60,7 +60,7 @@ public function convert(array $blocks, int $targetEmbeddedTemplateIndex): array // The host index combined with the index of the embedded template where the block can be used (target) // allows us to remember the link between the original name and the new randomized name. // That way we can map a call like `block(outerBlocks.block_name)` to the randomized name. - self::$stack[$blockName][$targetEmbeddedTemplateIndex][$hostEmbeddedTemplateIndex] = $newName; + $this->stack[$blockName][$targetEmbeddedTemplateIndex][$hostEmbeddedTemplateIndex] = $newName; } return $newBlocks; diff --git a/src/TwigComponent/src/EventDispatcher/ComponentEventDispatcher.php b/src/TwigComponent/src/EventDispatcher/ComponentEventDispatcher.php index 4321373b619..8bb4da05129 100644 --- a/src/TwigComponent/src/EventDispatcher/ComponentEventDispatcher.php +++ b/src/TwigComponent/src/EventDispatcher/ComponentEventDispatcher.php @@ -27,6 +27,8 @@ public function dispatch(object $event, ?string $eventName = null): object return $this->dispatcher->dispatch($event, $eventName); } + return $this->symfonyDispatcher->dispatch($event, $eventName); + $eventListeners = $this->symfonyDispatcher->getListeners($event::class); if (empty($eventListeners)) { return $this->dispatcher->dispatch($event, $eventName);