From fd15b6c4c25da0156585856c3154b8715b16178b Mon Sep 17 00:00:00 2001 From: Kori <11611623+Koricz@users.noreply.github.com> Date: Tue, 12 Sep 2017 15:33:34 +0200 Subject: [PATCH] Fix duplicate service names with same arguments --- src/Cronner/DI/CronnerExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cronner/DI/CronnerExtension.php b/src/Cronner/DI/CronnerExtension.php index ff3f4de..fe20b5f 100644 --- a/src/Cronner/DI/CronnerExtension.php +++ b/src/Cronner/DI/CronnerExtension.php @@ -90,7 +90,7 @@ public function loadConfiguration() Validators::assert($config['tasks'], 'array'); foreach ($config['tasks'] as $task) { - $def = $container->addDefinition($this->prefix('task.' . md5(Json::encode($task)))); + $def = $container->addDefinition($this->prefix('task.' . md5(is_string($task) ? $task : sprintf('%s-%s', $task->getEntity(), Json::encode($task))))); list($def->factory) = Compiler::filterArguments([ is_string($task) ? new Statement($task) : $task, ]);