File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
FrameworkBundle/Resources/config
DependencyInjection/Compiler Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 22
22
<service id =" workflow.marking_store.single_state" class =" Symfony\Component\Workflow\MarkingStore\SingleStateMarkingStore" abstract =" true" />
23
23
24
24
<service id =" workflow.registry" class =" Symfony\Component\Workflow\Registry" />
25
-
26
- <service id =" workflow.twig_extension"
10000
class =" Symfony\Bridge\Twig\Extension\WorkflowExtension" >
27
- <argument type =" service" id =" workflow.registry" />
28
- <tag name =" twig.extension" />
29
- </service >
30
25
</services >
31
26
</container >
Original file line number Diff line number Diff line change 18
18
use Symfony \Component \DependencyInjection \Reference ;
19
19
use Symfony \Component \ExpressionLanguage \ExpressionLanguage ;
20
20
use Symfony \Component \Stopwatch \Stopwatch ;
21
+ use Symfony \Component \Workflow \Workflow ;
21
22
use Symfony \Component \Yaml \Parser as YamlParser ;
22
23
23
24
/**
@@ -115,6 +116,13 @@ public function process(ContainerBuilder $container)
115
116
if (class_exists (ExpressionLanguage::class)) {
116
117
$ container ->getDefinition ('twig.extension.expression ' )->addTag ('twig.extension ' );
117
118
}
119
+
120
+ $ container ->addResource (new ClassExistenceResource (Workflow::class));
121
+ if (!class_exists (Workflow::class) || !$ container ->has ('workflow.registry ' )) {
122
+ $ container ->removeDefinition ('workflow.twig_extension ' );
123
+ } else {
124
+ $ container ->getDefinition ('workflow.twig_extension ' )->addTag ('twig.extension ' );
125
+ }
118
126
}
119
127
120
128
private function getComposerRootDir ($ rootDir )
Original file line number Diff line number Diff line change 106
106
107
107
<service id =" twig.extension.debug" class =" Twig_Extension_Debug" public =" false" />
108
108
109
+ <service id =" workflow.twig_extension" class =" Symfony\Bridge\Twig\Extension\WorkflowExtension" >
110
+ <argument type =" service" id =" workflow.registry" />
111
+ </service >
112
+
109
113
<service id =" twig.translation.extractor" class =" Symfony\Bridge\Twig\Translation\TwigExtractor" >
110
114
<argument type =" service" id =" twig" />
111
115
<tag name =" translation.extractor" alias =" twig" />
You can’t perform that action at this time.
0 commit comments