Skip to content

Commit

Permalink
Merge pull request #199 from RocKordier/symfony4_cache
Browse files Browse the repository at this point in the history
Use hash for definition ID generation instead of uniqid
  • Loading branch information
Olivier Dolbeau authored Sep 26, 2020
2 parents ddf09ef + 368e9a3 commit 44b7155
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DependencyInjection/SwarrotExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public function buildCommand(ContainerBuilder $container, string $name, array $c

private function buildCommandProcessorConfigurator(ContainerBuilder $container, string $commandName, array $middlewareStackConfig): string
{
$id = 'swarrot_extra.command.generated.'.$commandName.'.'.uniqid();
$hash = hash('md5', $commandName.serialize($middlewareStackConfig));
$id = 'swarrot_extra.command.generated.'.$commandName.'.'.$hash;

$definition = $container->setDefinition($id, new ChildDefinition($middlewareStackConfig['configurator']));
$definition->addMethodCall('setExtras', [$middlewareStackConfig['extras']]);
Expand Down

0 comments on commit 44b7155

Please sign in to comment.