Skip to content

Commit

Permalink
Fix duplicate service names with same arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Koricz authored and stekycz committed Nov 15, 2017
1 parent a3594ed commit fd15b6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Cronner/DI/CronnerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
Expand Down

0 comments on commit fd15b6c

Please sign in to comment.