Skip to content

Commit f0f4244

Browse files
committed
bug #72 Bugfix: Properly add tags to services (Nyholm)
This PR was merged into the master branch. Discussion ---------- Bugfix: Properly add tags to services We need to make sure we can reset all resettable services. Commits ------- 3a3eac3 Properly add tags to services
2 parents 767a215 + 3a3eac3 commit f0f4244

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/DependencyInjection/WebpackEncoreExtension.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ private function entrypointFactory(ContainerBuilder $container, string $name, st
8282
$name,
8383
$strictMode,
8484
];
85-
$container->setDefinition($id, new Definition(EntrypointLookup::class, $arguments));
85+
$definition = new Definition(EntrypointLookup::class, $arguments);
86+
$definition->addTag('kernel.reset', ['method'=>'reset']);
87+
$container->setDefinition($id, $definition);
8688

8789
return new Reference($id);
8890
}

src/Resources/config/services.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<service id="Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollectionInterface" alias="webpack_encore.entrypoint_lookup_collection" />
1515

1616
<service id="webpack_encore.tag_renderer" class="Symfony\WebpackEncoreBundle\Asset\TagRenderer">
17+
<tag name="kernel.reset" method="reset" />
1718
<argument type="service" id="webpack_encore.entrypoint_lookup_collection" />
1819
<argument type="service" id="assets.packages" />
1920
<argument type="collection" />

0 commit comments

Comments
 (0)