Skip to content

Commit

Permalink
dfdf
Browse files Browse the repository at this point in the history
  • Loading branch information
smnandre committed Nov 11, 2024
1 parent 8a1c15c commit ffebaf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TwigComponent/src/BlockStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class BlockStack
/**
* @var array<string, array<int, array<int, string>>>
*/
private static array $stack = [];
private array $stack = [];

/**
* @var array<class-string, int>
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ffebaf1

Please sign in to comment.