Skip to content

Commit 022d3d0

Browse files
committed
Merge pull request #97 from symfony-cmf/simplifed_always_checker
simplified logic for setting the always publish workflow checker
2 parents 5b5127f + 4f96305 commit 022d3d0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

DependencyInjection/CmfCoreExtension.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,10 @@ public function load(array $configs, ContainerBuilder $container)
190190
$templatingHelper->replaceArgument(1, new Reference($config['persistence']['phpcr']['manager_registry']));
191191
}
192192
if ($config['publish_workflow']['enabled']) {
193-
$checker = $this->loadPublishWorkflow($config['publish_workflow'], $loader, $container);
193+
$this->loadPublishWorkflow($config['publish_workflow'], $loader, $container);
194194
} else {
195195
$loader->load('no-publish-workflow.xml');
196-
$checker = 'cmf_core.publish_workflow.checker.always';
197196
}
198-
$container->setAlias('cmf_core.publish_workflow.checker', $checker);
199197

200198
if (isset($config['multilang'])) {
201199
$container->setParameter($this->getAlias() . '.multilang.locales', $config['multilang']['locales']);
@@ -235,8 +233,6 @@ public function setupFormTypes(ContainerBuilder $container, LoaderInterface $loa
235233
* @param XmlFileLoader $loader
236234
* @param ContainerBuilder $container
237235
*
238-
* @return string the name of the workflow checker service to alias
239-
*
240236
* @throws InvalidConfigurationException
241237
*/
242238
private function loadPublishWorkflow($config, XmlFileLoader $loader, ContainerBuilder $container)
@@ -255,7 +251,7 @@ private function loadPublishWorkflow($config, XmlFileLoader $loader, ContainerBu
255251
$container->removeDefinition($this->getAlias() . '.admin_extension.publish_workflow.time_period');
256252
}
257253

258-
return $config['checker_service'];
254+
$container->setAlias('cmf_core.publish_workflow.checker', $config['checker_service']);
259255
}
260256

261257
/**

Resources/config/no-publish-workflow.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<services>
1212

13-
<service id="cmf_core.publish_workflow.checker.always" class="%cmf_core.publish_workflow.checker.class%"/>
13+
<service id="cmf_core.publish_workflow.checker" class="%cmf_core.publish_workflow.checker.class%"/>
1414

1515
</services>
1616
</container>

0 commit comments

Comments
 (0)